Creating a Yearly Archives Pod in blogCFC
This post is to show how we can create a yearly archive pod in blogCFC. I have recently modified my blogCFC design and I’m really happy on that customization. So the first thing we need to do is adding a new function in the blog.cfc component which is under org > camden > blog folder in your blog root.
In getYearlyArchives function we are just retrieving the blogged years from tblblogentries table. Next we need to change the code in two important files the first one is parseses.cfm which is under tags folder of your blog root.
This code need to be replaced with the following code.
Now we have created a new mode called year and assigned the value of categoryName which is nothing but the year to url.year. Next we need edit the getmode.cfm file which is under the same tags folder of your blog. Add this code just below the second cfelseif statement.
Here in this code we are setting the selected year value to params.byYear and year parameters. We have done with the code changes and now we can create a pod in blogCFC administrator for to display the list of years in your blog.
Just paste this code in your new pod and save. You can view the sidebar of this blog where I included the yearly archives pod. The existing blogCFC functionality will create the necessary page navigation while clicking the more entries link in the blog. Let me know if you have any issues in implementing this code.
Comments
Hey Nice work!! Will the same way works for monthly archives? If yes, can you please give me the steps. Thank you
@anjali, You can follow the steps for creating the Monthly Archive at Rob Brooks-Bilson's Blog here - http://ur.ly/4euv
Thanks for your reply Akbar, But i tried it. I liked the way how you did. Anyway thank you, I will try to do with Rob's code. You have a good week.
(Comments migrated from previous blog engine.)