Modifying archive so it doesn't show individual posts
Is it ppossible to modify the archive so it doesn't show the individual posts but instead clicking the month shows all the posts for that month. This kind of layout
2012 -- January (2) -- February (3)
where clicking the year hides or shows the list of months and clicking the month name shows the posts for that monthas a landing page.
tbh I'm not really sure. I haven't done any razor or linq other than modifying a few of the uBlogsy files to alter the way the blog is displayed so not really sure what can be done.
What I was thinking was selecting all the years from the list of nodes, sorted in descending order. Then looping that list and within it selecting all the months that have posts in that year, again sorted in descending order.
Its perfectly fine. Thank you for getting back to me.
Its good to see how you made it work.
I notice that your links of your months use a custom link. Have you made a new "uBlogsyShowPost" section, or did you make a new template to show the list of posts for the selected month?
Modifying archive so it doesn't show individual posts
Is it ppossible to modify the archive so it doesn't show the individual posts but instead clicking the month shows all the posts for that month. This kind of layout
2012
-- January (2)
-- February (3)
where clicking the year hides or shows the list of months and clicking the month name shows the posts for that monthas a landing page.
Yes you can do that.
You'll have to modify the Archive script to not render the posts, and also modify the jquery at the top of the script to not bind to the click event.
Then what you can do is create a new template for uBlogsyFolderMonth which renders children of the month node.
Is it possible to select the years and months using Linq instead of looping all the posts.
Razor is just c#, and Umbraco is just .net so you can do anything you like.
What exactly do you want to do with Linq?
tbh I'm not really sure. I haven't done any razor or linq other than modifying a few of the uBlogsy files to alter the way the blog is displayed so not really sure what can be done.
What I was thinking was selecting all the years from the list of nodes, sorted in descending order. Then looping that list and within it selecting all the months that have posts in that year, again sorted in descending order.
You could do that if you want:
foreach (var yearFolder in (landing.Descendents("uBlogsyFolderYear")){
foreach (var monthFolder in (yearFolder.Descendents("uBlogsyFolderMonth")){
foreach (var post in (yearMonth.Descendents("uBlogsyPost")){
// .. do somethign
}
}
}
Sometimes you can't see the easy solution for the hard one :(
That worked. Thanks.
Hi Suzyb,
I have been to your company website and see that you got your grouping of blog posts in the archive section sorted.
Are you able to give examples of your code as i have been requested to do the same thing yet im looking through this post and not getting very far.
Craig
Sorry, I didn't notice your post till now. Here is the code we use in case it's still of some use.
Its perfectly fine. Thank you for getting back to me.
Its good to see how you made it work.
I notice that your links of your months use a custom link. Have you made a new "uBlogsyShowPost" section, or did you make a new template to show the list of posts for the selected month?
IIRC we modified the post listing so we could list by month.
Awesome, thank you so much for your help. Massively appreciate it.
is working on a reply...