Checkbox group "widgets" on/off
I want to create a sidebar and allow them to on/off widgets with a checkbox group.
So far i have the code below which works well, but it isn't this flexible with the option names.
Does anybody has a idea how to make this more flexible or just to make the code nicer?
{exp:low_variables:options var="lv_sidebar"}
{if lv_sidebar:data == "Programma" AND active == "y"}
{embed="widgets/program"}
{/if}
{if lv_sidebar:data == "Nieuws" AND active == "y"}
{embed="widgets/nieuws"}
{/if}
{if lv_sidebar:data == "Nieuwsbrief" AND active == "y"}
{embed="widgets/nieuwsbrief"}
{/if}
{if lv_sidebar:data == "Agenda" AND active == "y"}
{embed="widgets/agenda"}
{/if}
{if lv_sidebar:data == "Pupil van de Week" AND active == "y"}
{embed="widgets/pupil"}
{/if}
{/exp:low_variables:options}
Replies
Low 22 Nov 2012 10:08
You could try a setup with Matrix, perhaps.
edwinvermaas 22 Nov 2012 12:55
With matrix it works very well, thanks for the tip. Next obstacle is to customize it for every page, so the user can decide which widget is on a specific page.
More tips are welcome :D
Cell1 = Title
Cell2 = Checkbox
Cell3 = Embed code without {}
This will look for now like this: