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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

widget framework


Reply


2 Posts   1557 Views

Avatar
Decisive Flow

Community Member, 73 Posts

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. :)

Avatar
Sam

Administrator, 685 Posts

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:

$Widget(TagCloud)

Or you could render the TagCloud object using custom HTML, if the widget was set up for it:

<ul>
<% control Widget(TagCloud) %>
<li class="size$Size"><a href="$Link">$Tag</a></li>
<% end_control %>
</ul>

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?