Hey everyone. I wanted to share with you this new HubL idea. I decided to create a topic icon that shows on my posts on the listing page. To achieve this I needed some way to tell the CSS what topics each post has. This is the code I came up with.
Replace finds the spaces, if more than one word and replaces them with a dash.
When all said and done I now will have the topic showing as a CSS class in the HTML. With my CSS code using font awesome to pull in the correct icon. This may not work for all. The way I use my topics is I need the last filter because I rely on the last topic added for each post. This would work amazingly well if you only use one topic per post. Live example at http://www.tinyhouseofmouse.com