Elijah
-
1/24/2009 8:20:08 AM
RE:Kentico blog questions
In regard to tags and categories, version 4.0 appears to support those concepts natively.
For pre-4.0, however, you can still do this, just with a little more work. I haven't implemented Categories on my site, but here's how I did tags:
First I added a new text field to the blog post document type, called BlogPostTags. Then for each post I enter a comma separated list of tags in this field (optional).
I then wrote a static method in my utility library (App_Code\<SiteName>\Util.cs) to accept a comma separated list and return a list of links (with the specified tag as a "tag" querystring parameter) to the "find by tag" page that I created.
In any transformation, I can use a bit of code like this:
<%# Util.GetTagLinks(Eval("BlogPostTags")) %>
Then on the "find by tag" page, I placed a repeater that has a "where" clause that says something like this: BlogPostTags LIKE '%{%tag%}%'
You can see this in action here: http://www.elijahtaylor.com/Blog/Find-By-Tag.aspx?tag=seth
Hope this helps! Elijah
|