17488 Posts in 4473 Topics by 1978 members
|Go to End|
23 May 2007 at 9:01am
I've just been updating the PlanHQ site, to which we've added bits like tag clouds etc. So far we've been adding them into the php file of the template which means a lot of duplication. Is silverstripe planning some sort of widget framework? Ie. a default folder called 'widgets' that holds the php include files for extra widgety type code people write?
Most other CMS's have this sort of thing and it works well for us. It also means things like tag clouds become somewhat standard which is nice.
23 May 2007 at 10:52am
It's a good idea, Natalie...
If we had a method called Widget on ViewableData, that instanciated the classname given in the argument, you could then put something like this into your code:
Or you could render the TagCloud object using custom HTML, if the widget was set up for it:
<% control Widget(TagCloud) %>
<li class="size$Size"><a href="$Link">$Tag</a></li>
<% end_control %>
To make a TagCloud, you'd need to have some kind of TemplateWidget API. Natalie, what was the code that you used to make your tag cloud?
|Go to Top|