Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Custom tag cloud

Go to End



Community Member, 5 Posts

23 March 2009 at 3:23am

Hi there, I'm still very new to Silverstripe, and struggling with some stuff... I hope someone here can help me a little!

Portfolio website for author
I'm working on a portfolio website for an author. He's got many short texts that he has written in magazines, books, newspapers and so on, and on this site he wants to showcase them.

ContentItemPage and TextCategory
To do this each text (ContentItem) is put on the site as a separate page with page type ContentItemPage. For each item a category can be set (for example: essay, review, fiction, etcetera). I've managed to create a DataObject called TextCategory for this. The admin can select an existing TextCategory or add one to the list and use that one. This is all working fine.

Problem: tag cloud
Now the problem is: I want to display all the TextCategories that have been made by the admin in a tag cloud on the homepage. So what I want to do is go through all the Content Items, and count how many times each TextCategory has been applied to a Content Item, and visualize this in the tagcloud.

It's not working...
I have tried many things, even using raw SQL to get this result, but nothing is working. I'm probably doing some little stupid thing wrong. Maybe someone can give me a hint in which direction I should be thinking? There must be an easy way to do something like this in Silverstripe...(I hope ;-)

(BTW: I'm not using the blog module)