Hello everyone.
In an earlier post, I asked about whether Sparkle had tags and explained the value they provide. Since Sparkle does not have tags (I think tags are difficult for Duncan to implement since I think such a feature would need a database backend which introduces numerous technical complications), I’ve implemented a poor man’s manual tagging approach I’d like to share.
(Tagging is a valuable feature for those doing blog sites - such as myself - and with Sparkle 3.x blog features, blog sites are now rather simple to produce in Sparkle.)
Overall, I use buttons linking to Regular pages that contain listings of the blog posts containing the buttons. I place the buttons on blog posts. The result is when a visitor views a blog post, they see the tags assigned. Click on a tag and the visitor sees a listing of all the blog posts with that same tag. Click on a listing entry and the visitor is taken to that blog post where that blog post’s tags are visible and so on.
Here are the high level steps I took:
- I created a blank Regular page for each button. This page will be the “index” for posts with each tag. In other words, it will contain the listing of posts containing a tag.
- I named each “index” page “TOC - X” where TOC stands for table of contents and X is the name of each tag. I did this as opposed to using the word “Index” so I would not confuse myself with Sparkle’s index files it creates.
- I created a blank Regular page that contained a set of buttons with each being a “tag”. I excluded this page from publishing, searching, and menus.
- I titled each Regular page “Index - X” where X is the name of each tag.
So at this point, there is a button for each tag and a corresponding page that will contain a listing of those blog posts with that tag.
- I tagged each blog post by placing an appropriate tag button on the page post.
- I created a linked text box on the appropriate TOC page containing the name of the blog post.
So at this point, I have a blog post with a button that takes the visitor to the TOC page and a TOC page that has a text box link taking the visitor back to the blog post.
- Since a blog post can have more than one tag button, I repeated this step for all the tags assigned to that blog post and for all blog posts.
Being that this is all manual, the work is making sure the right tags are on the right blog posts and the right entries are on the right TOC pages. My site has six tag buttons and six corresponding TOC pages. For each new blog post, I place the appropriate tag buttons on the blog post and enter a text box linked to the blog post on each TOC file associated with the blog post’s tags.
I could have had Sections defined for each “tag” and duplicated blog posts into each appropriate Section. This would have allowed me to have Sparkle create the indices. However, that would also mean I would be responsible for version control across the Sections. In other words, if I changed a blog post, I would have to change all the duplicate blog posts across the Sections. I would rather maintain the TOC files than ensuring a blog post was properly sync’d across the Sections.
I hope this provides food for thought for those who are using Sparkle for blogging.
Post script: Enhancement opportunities - I am thinking about updating the TOC files to contain a blog post’s tags along with its listing. This would provide the visitor with greater insight into a blog post without going to the blog post itself and providing quicker access to the other TOC files.