I thought I would try to see if I couldn't just define my group of content blocks once and then loop through them in the template, but it doesn't seem possible at first glance?
I get only the first section of content blocks in my page template but the dynamic values for block name, label, etc. are displayed as ((string)$_smarty_tpl->tpl_vars['section']->value['id']). It might not be possible to do it dynamically, so I'll have to stick to hard coding all content blocks?
Example code:
Code: Select all
{assign var='sections' value=[
['id' => 'section01', 'legend' => 'Section 1', 'default_class' => 'my-0 py-0 header-stick', 'default_bgcolor' => 'bg-transparent'],
['id' => 'section02', 'legend' => 'Section 2', 'default_class' => 'my-0', 'default_bgcolor' => 'bg-transparent'],
['id' => 'section03', 'legend' => 'Section 3', 'default_class' => 'my-0', 'default_bgcolor' => 'bg-transparent'],
['id' => 'section04', 'legend' => 'Section 4', 'default_class' => 'my-0', 'default_bgcolor' => 'bg-transparent'],
['id' => 'section05', 'legend' => 'Section 5', 'default_class' => 'my-0', 'default_bgcolor' => 'bg-transparent'],
['id' => 'section06', 'legend' => 'Section 6', 'default_class' => 'my-0', 'default_bgcolor' => 'bg-transparent']
]}
{foreach from=$sections item=section}
{content_module module='ECB2' field='fieldset_start' label=' ' block="`$section.id`_fieldset" legend="`$section.legend`"}
{assign var="`$section.id`_id" value="{content block="`$section.id`_id" label='Anchor (section ID)' wysiwyg='false' oneline='true'}" scope="global"}
{assign var="`$section.id`_class" value="{content block="`$section.id`_class" label='Section Class' wysiwyg='false' oneline='true' default="`$section.default`_class"}" scope="global"}
{assign var="`$section.id`_style" value="{content block="`$section.id`_style" label='Section Style' wysiwyg='false' oneline='true'}" scope="global"}
{content_module module='ECB2' field='fieldset_end' label=' ' block="`$section.id`_fieldsetend"}
{/foreach}