Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dave 36 posts 149 karma points
    Apr 23, 2015 @ 15:07
    dave
    0

    Categories page with Articulate

    So I was able to get my blog articles on the home page of my umbraco site..great.

    I was looking at categories next and found the list of categories via a link like http://localhost/blog/categories

    1) I was trying to find where the view was for this page and was not able to find. I am thinking I could create my own view like i did for recent blog entries however i was a bit stumped when i tried to figure out how blog/categories was getting rendered (i mean it must be using a view somewhere right?)

    2) It doesn't look like we have the .cs code files for Articulate (are they available somewhere?) maybe the view is within that solution/project?

    thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 23, 2015 @ 15:09
    Jan Skovgaard
    0

    Hi Dave

    You can find the source code for Articulate here https://github.com/Shazwazza/Articulate - That should make it possible for you to fork it and make your own version of just explore the source code to figure out what goes on behind the scenes.

    Hope this helps in regards to your second question.

    /Jan

  • dave 36 posts 149 karma points
    Apr 24, 2015 @ 02:31
    dave
    0

    Where would the view be for 'categories'?

    thx

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Apr 27, 2015 @ 03:23
    Shannon Deminick
    0

    All views are part of the theme. The view for categories is:

    ~/App_Plugins/Articulate/[THEMENAME]/Views/Tags.cshtml

    for example, see the Shazwazza theme views:

    https://github.com/Shazwazza/Articulate/tree/master/Articulate.Web/App_Plugins/Articulate/Themes/Shazwazza/Views

    As the documentation states, each theme exposes various features, not all themes support the categories/tags page (categories are also tags which is why it is named that way)

  • dave 36 posts 149 karma points
    Apr 28, 2015 @ 03:10
    dave
    1

    Great

    I am trying to create a partial view which I could place on the master page to show the categories.

    @Html.Partial("/App_Plugins/Articulate/Views/displayblogcategoriesonhomepage.cshtml", new Articulate.Models.ListModel(Umbraco.Content(1103)))

    In my partial view I have the following

    @inherits Umbraco.Web.Mvc.UmbracoViewPage

    var articulateMasterModel = Model as IMasterModel;
    var rr = Model;
    //var asArray = root.Tags.ToArray();
    

    }

    Comparing to the Tags.cshtml that exists in the Vapor theme, how do I navigate from IMasterModel to Articulate.Models.TagListModel in order to iterate over the categories? What is confusing is the hierarchy from IMasterModel to the Articulate object model.

    I have googled looking for clues but still no success. Any help would be very much appreciated.

  • dave 36 posts 149 karma points
    Apr 28, 2015 @ 15:21
    dave
    100

    I think I was able to work through this. The umbraco model is quite new to me and it seems I am missing some base concept right now.

    This is what I have working.

    In my master page @Html.Partial("/App_Plugins/Articulate/Views/displayblogcategoriesonhomepage.cshtml", new Articulate.Models.ListModel(Umbraco.Content(1103)))

    In my partial view

    @using Articulate
    @using Articulate.Models
    @using Umbraco.Core
    @using Umbraco.Web
    @inherits Umbraco.Web.Mvc.UmbracoViewPage<IPublishedContent>
    @*@inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>*@
    @{   
    var articulateMasterModel = Model as IMasterModel;
    
    //var con = Umbraco.Content(1103);
    //var categories = Umbraco.GetAllCategories(articulateMasterModel);    
    var categories = Umbraco.GetPostTagCollection(articulateMasterModel);    
    }
    <h3>Categories</h3>
    <ul>@{
    int i = 0;
    foreach (var cat in categories)
    {
        <li>
            <a href="@cat.TagUrl">@cat.TagName</a> - (@cat.PostCount)
        </li>
        i += 1;
    }}    
    </ul>
    

    While the above works, it was very confusing that I had to send as parameter new Articulate.Models.ListModel(Umbraco.Content(1103). I guess that represents the IPublishedContent (root node blog) and so I then found a helper which gave me the tagcollection.

    Where would I find some documentation on this type of architecture?

    thx

Please Sign in or register to post replies

Write your reply to:

Draft