Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » widget framework

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

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

Page: 1
Go to End
Author Topic: 1503 Views
  • Decisive Flow
    Community Member
    73 Posts

    widget framework Link to this post

    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.

  • Sam
    679 Posts

    Re: widget framework Link to this post

    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?

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.