Displaying a simple list of the latest blog posts in a partial view
Yeah it seems a bit silly to need help to this, but I havent used umbraco since version 4 or something like that. I have fiddled around with this for a while, but don't have any working code to show. My intentions is to have a small partial view that can essentially be "plopped in" anywhere and it will show, for example, a list of the 8 latest posts on the blog as a link with the author and date, nothing more.
How can I do this?
Thanks for the suggestion, but I think that looks a bit more than what I have in mind. What I'm talking about is something like this:
A widget of sorts that should be located in a sidebar, but can technically be inserted anywhere, that lists for example the five latest blog posts like in the image.
I just recently fixed it myself, so just posting it here in case anyone comes by searching for the same solution.
I have a custom Articulate theme, and in the themes Master.chstml is a reference to a themed partial like so:
@Html.ThemedPartial(Model, "Sidebar")
In that partial I have the following code (code not necessary for this example has been removed:
Displaying a simple list of the latest blog posts in a partial view
Yeah it seems a bit silly to need help to this, but I havent used umbraco since version 4 or something like that. I have fiddled around with this for a while, but don't have any working code to show. My intentions is to have a small partial view that can essentially be "plopped in" anywhere and it will show, for example, a list of the 8 latest posts on the blog as a link with the author and date, nothing more. How can I do this?
Hi Frederik,
Here is a partial that I wrote for my Clean Starter Kit
https://github.com/prjseal/Clean-Starter-Kit-for-Umbraco/blob/master/src/Clean.Web/Views/Partials/latestArticles.cshtml
Then I call it from any page like this:
Thanks for the suggestion, but I think that looks a bit more than what I have in mind. What I'm talking about is something like this:
A widget of sorts that should be located in a sidebar, but can technically be inserted anywhere, that lists for example the five latest blog posts like in the image.
I just recently fixed it myself, so just posting it here in case anyone comes by searching for the same solution. I have a custom Articulate theme, and in the themes Master.chstml is a reference to a themed partial like so:
In that partial I have the following code (code not necessary for this example has been removed:
Hope this will help anyone with a similar issue.
is working on a reply...