Jump to:

794 Posts in 408 Topics by 304 members

Widgets

SilverStripe Forums » Widgets » Widget in template / isEmpty [solved]

Discuss SilverStripe Widgets.

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

Page: 1
Go to End
Author Topic: 762 Views
  • rob.s
    Avatar
    Community Member
    78 Posts

    Widget in template / isEmpty [solved] Link to this post

    Hi,

    how do i recognize if widget area is empty ?
    I need this inside the template

    The name of my widgetArea is 'SideBlock'

    The following template code does NOT work for me.
    (guessing the method SideBlock() only returns false/null when the relation does not exist)

    <% if SideBlock %>
    <div class="span-18">
    <% else %>
    <div class="span-24 last">
    <% end_if %>

    Any ideas ?

    Grettings,
    Rob

  • rob.s
    Avatar
    Community Member
    78 Posts

    Re: Widget in template / isEmpty [solved] Link to this post

    Solution:

    <% if SideBlock.Widgets %>
    <div class="span-18">
    <% else %>
    <div class="span-24 last">
    <% end_if %>

    762 Views
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.