To allow certain aspects of articulate to be customisable (eg url names) Articulate uses a sophisticated routing technique, which involves created a VirtualNodeRouteHandler. You can see in the source of Articulate where this is setup:
and RenderByTagOrCategory method pulls back content by tag or category and populates a ListModel, containing posts and the category you are searching by, returning the following:
Thanks Marc, that definitely helps. I am trying to display all of the blog posts on the primary blog page, so when a user navigates to the blog they are presented with all of the blog posts.
I partially did this with the recent.cshtml view. However, I have run into issues with adding a pager to the recent.cshtml - it does not work correctly when calling the pager partial view in the list.cshtml view. I would just keep the recent.cshtml view is the main landing page, but when the number of blog posts substantially increases, I am worried that without the pager, things will be slow to load, and you cannot call all blog posts in the recent partial view...only a specified number.
So I have been trying to determine a way to do the above with the tags.cshtml view, since I cannot add a pager to the recent partial view, nor use the recent partial to display all blog posts.
Hi @marc, exactly! I am looking for either that, or paging, but I do like that load more option if it is simpler than dealing with the pager :s and recent.cshtml view.
how does the /categories/ page work?
Hi,
How does the categories page work, and in what view / partial view is the code located?
I can't seem to totally find it. I see that some of it is in the Tags.cshtml view, but not all of it.
Hi Bobi
To allow certain aspects of articulate to be customisable (eg url names) Articulate uses a sophisticated routing technique, which involves created a VirtualNodeRouteHandler. You can see in the source of Articulate where this is setup:
https://github.com/Shazwazza/Articulate/blob/master/src/Articulate/ArticulateTagsRouteHandler.cs
and here you can see the rules for finding content for a request based on the provided custom urls configured for articulate for tags, categories etc.
The following ArticulateTagsController is then triggered for a request to a categories page:
https://github.com/Shazwazza/Articulate/blob/master/src/Articulate/Controllers/ArticulateTagsController.cs
and RenderByTagOrCategory method pulls back content by tag or category and populates a ListModel, containing posts and the category you are searching by, returning the following:
return View(PathHelper.GetThemeViewPath(listModel, "List"), listModel);
The GetThemeViewPath will look for the current Articulate Theme folder eg
/app_plugins/articulate/themes/[YourThemeName]
and within the Views folder of your theme it is returning the List.cshtml view.
If that helps understand what on earth is going on :-)
regards
Marc
Thanks Marc, that definitely helps. I am trying to display all of the blog posts on the primary blog page, so when a user navigates to the blog they are presented with all of the blog posts.
I partially did this with the recent.cshtml view. However, I have run into issues with adding a pager to the recent.cshtml - it does not work correctly when calling the pager partial view in the list.cshtml view. I would just keep the recent.cshtml view is the main landing page, but when the number of blog posts substantially increases, I am worried that without the pager, things will be slow to load, and you cannot call all blog posts in the recent partial view...only a specified number.
So I have been trying to determine a way to do the above with the tags.cshtml view, since I cannot add a pager to the recent partial view, nor use the recent partial to display all blog posts.
Any ideas?
Hi Bobi
I think I understand what you mean.
I created a blog a while back in an early version of articulate:
http://dickiefelton.com/
and if you scroll down and see, additional posts on the homepage can be loaded asynchronously by clicking the 'Load More Posts' option.
This way people can still keep browsing blog articles if they wish, but the first load of the blog is kept small and loads reasonably quickly.
regards
Marc
Hello, how did you do the Load more action in your blog? Can you explain me please how to achieve this? Thank you!
Hi @marc, exactly! I am looking for either that, or paging, but I do like that load more option if it is simpler than dealing with the pager :s and recent.cshtml view.
How did you do this? My recent looks like:
is working on a reply...