Page 1 of 1
Remove sidebar in staticpages?
Posted: Sat Aug 18, 2007 4:44 pm
by bdconnolly
Help please.
Can anyone give me a hint as to how I might remove the sidebar only with the static pages?
Thanks in advance.
BC
Re: Remove sidebar in staticpages?
Posted: Mon Aug 20, 2007 9:18 am
by garvinhicking
Hi!
Is there a specific reason why you want such a blog page to be a static page? You could simply upload a HTML file with your layout in that case, as it wouldn't really require the blog layout in this case?
You can only achieve that by editing your sidebar.tpl template file and inserting a Smarty-Check to hide the output, if you are on the specific staticpage:
Code: Select all
{if $staticpage_pagetitle != 'your_specific_staticpage'}
...here all the code of sidebar.tpl...
{/if}
Regards,
GArvin
Posted: Mon Aug 20, 2007 2:25 pm
by bdconnolly
Yes... I could do it by html but I already have 7 static pages and to redo all would be a pain.
With regard to the code you recommend... where exactly? Also note, I want to hide the sidebar in ALL instances not just a specific page.
Code: Select all
{if $is_raw_mode}
<div id="serendipity{$pluginside}SideBar">
{/if}
{foreach from=$plugindata item=item}
<div class="serendipitySideBarItem container_{$item.class}">
{if $item.title != ""}<h3 class="serendipitySideBarTitle {$item.class}">{$item.title}</h3>{/if}
<div class="serendipitySideBarContent">{$item.content}</div>
</div>
{/foreach}
{if $is_raw_mode}
</div>
{/if}
Posted: Mon Aug 20, 2007 2:58 pm
by garvinhicking
Hi!
Code: Select all
{if $staticpage_plugintitle == 'staticpage_title_1' OR $staticpage_plugintitle == 'staticpage_title_2' or $staticpage_plugintitle == 'staticpage_title_2'}
<!-- do nothing -->
{else}
{if $is_raw_mode}
<div id="serendipity{$pluginside}SideBar">
{/if}
{foreach from=$plugindata item=item}
<div class="serendipitySideBarItem container_{$item.class}">
{if $item.title != ""}<h3 class="serendipitySideBarTitle {$item.class}">{$item.title}</h3>{/if}
<div class="serendipitySideBarContent">{$item.content}</div>
</div>
{/foreach}
{if $is_raw_mode}
</div>
{/if}
{/if}
Replace staticpage_title_1, staticpage_title_2 etcc. with the names of your pages.
Regards,
Garvin
Posted: Mon Aug 20, 2007 3:13 pm
by bdconnolly
thank you!
Posted: Mon Aug 20, 2007 4:09 pm
by bdconnolly
oops. Too fast.
test failed. {if $staticpage_plugintitle == 'About'} does nothing.
"About" is the name of the page. Am I doing it wrong?
Posted: Mon Aug 20, 2007 4:19 pm
by garvinhicking
Hi!
The right variable is $staticpage_pagetitle, sorry.
Regards,
Garvin
Posted: Mon Aug 20, 2007 5:29 pm
by bdconnolly
close. indeed the sidebar content disappears. But I'd like for the entire sidebar to disappear and the static entry content to assume the entire area.
Sorry for the miscommunication.
Thoughts?
Posted: Mon Aug 20, 2007 7:13 pm
by stm999999999
in your index.tpl there must be something like
Code: Select all
{serendipity_printSidebar side="right"}
perhaps in a div or a tabel-element (depends on your template).
Do this into the if-clause.
And BTW, @Garvin: Isn't there a variable like "is_staticpage"?)
Posted: Mon Aug 20, 2007 10:31 pm
by bdconnolly
yep, but that still leaves the "content" with the same id.
This works:
Code: Select all
<table id="mainpane">
<tr>
{if $leftSidebarElements > 0}
<td id="serendipityLeftSideBar" valign="top">{serendipity_printSidebar side="left"}</td>
{/if}
{if $staticpage_pagetitle == 'About'}
<td id="staticpage" valign="top">{$CONTENT}</td>
{else}
<td id="content" valign="top">{$CONTENT}</td>
{/if}
{if $staticpage_pagetitle == 'About'}
<!-- do nothing -->
{else}
{if $rightSidebarElements > 0}
<td id="serendipityRightSideBar" valign="top">{serendipity_printSidebar side="right"}</td>
{/if}
{/if}
</tr>
</table>