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. Check the sidebar of my blog where I have included the yearly archives pod and the existing blogCFC functionality will create the necessary page navigation while clicking the more entries link in your blog. Please let me know if you have any issues in using this code and suggest me if anything is wrong in the above code.
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.
CFML/Web/Cloud/Data/Agile Enthusiast, Husband & Dad, an avid learner & android fan who works as a Tech Consultant in Toronto, Canada.
GetCFMLJobs.com!
Get Your Next CFML Job!
ColdFusion Tuts
ColdFusion Tutorials & Resources
Adobe Agile AppCore Creator BlogCFC Books Bootstrap CFBuilder CFEclipse CFML Chennai CFUG Chrome Extensions ColdFusion Google IIS India Learning MySQL Railo Subversion Tools & Utilities Web Windows 7
2021 2018 2017 2016 2014 2013 2012 2011 2010 2009 2008