Hi,
is there a possibility to check if a site has widgets?
Because the way I included the widgets is the following:
themes/THEME-NAME/templates/Layout/Page.ss:
<div class="typography">
<div id="Widgetbar" class="typography">
$Sidebar
</div>
<% if Menu(2) %>
<% include SideBar %>
<% end_if %>
<div id="Content">
<% if Level(2) %>
<% include BreadCrumbs %>
<% end_if %>
<h2>$Title</h2>
$Content
$Form
$PageComments
</div>
</div>
In this way you will always see the widgets, if there was one added to the site, but the css of the Widgetbar keeps always the size for it, also if there isn't a widget added to a page, therefor I wanted to know, if there is a function to check if a site has a widget, or where to put such a function. The new Page.ss should look something like this:
<div class="typography">
<% if SiteHasWidget() %>
<div id="Widgetbar" class="typography">
$Sidebar
</div>
<% else_if Menu(2) %> // Don't even know how "else if" should look like in ss, please correct me if this is wrong
<% include SideBar %>
<% end_if %>
<div id="Content">
<% if Level(2) %>
<% include BreadCrumbs %>
<% end_if %>
<h2>$Title</h2>
$Content
$Form
$PageComments
<% if SiteHasWidget() || Menu(2) %> // I also don't know how to write an "or" operation in ss, please also correct me if I'm wrong
</div>
<% end_if %>
</div>
The CSS for Widgetbar is the same as for Sidebar, the only difference is that, the Widgetbar will be displayed on the right and the original Sidebar will be displayed on the left of the content.
Thanks for any advice.
Regards
Fabian