[Solved] Hiding empty content block--dupe block names error?
Posted: Fri Feb 24, 2012 4:28 pm
Using CMSms 1.10.3, new install, no extra modules yet.
Trying to set up a 2/3-column template where the right-hand column (sidebar_right) only appears if there's content. I've got this basic logic, picked up from some similar questions in this forum:
{capture assign='testvar'}{content block='contents-rt' label='RIGHT Sidebar Content (optional)'}{/capture}
{if isset($testvar) && !empty($testvar)}
<div id="main" class="grid_6">
<div id="contentmain">
{content label="MAIN Content Area"}
</div>
</div>
<div id="sidebar_right" class="grid_3 omega">
<div id="contentright">
{$testvar}
</div>
</div>
{else}
<div id="main" class="grid_9 omega">
<div id="contentmain">
{content label="MAIN Content Area"}
</div>
</div>
{/if}
So basically the main content area should get wider if the right column has no content. Right column just would not appear at all.
When I try to add a new content page with this template, I get this:
An error occurred parsing content blocks (perhaps duplicated block names)
Also, none of the content areas are showing on the New Content page?
Seems like I am really close, but missing some important detail here. Suggestions, pointers, ideas anyone?
Thanks
Trying to set up a 2/3-column template where the right-hand column (sidebar_right) only appears if there's content. I've got this basic logic, picked up from some similar questions in this forum:
{capture assign='testvar'}{content block='contents-rt' label='RIGHT Sidebar Content (optional)'}{/capture}
{if isset($testvar) && !empty($testvar)}
<div id="main" class="grid_6">
<div id="contentmain">
{content label="MAIN Content Area"}
</div>
</div>
<div id="sidebar_right" class="grid_3 omega">
<div id="contentright">
{$testvar}
</div>
</div>
{else}
<div id="main" class="grid_9 omega">
<div id="contentmain">
{content label="MAIN Content Area"}
</div>
</div>
{/if}
So basically the main content area should get wider if the right column has no content. Right column just would not appear at all.
When I try to add a new content page with this template, I get this:
An error occurred parsing content blocks (perhaps duplicated block names)
Also, none of the content areas are showing on the New Content page?
Seems like I am really close, but missing some important detail here. Suggestions, pointers, ideas anyone?
Thanks