Remove sidebar in staticpages?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Remove sidebar in staticpages?

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Remove sidebar in staticpages?

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post 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}
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post by bdconnolly »

thank you!
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

The right variable is $staticpage_pagetitle, sorry.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post 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?
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post 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"?)
Ciao, Stephan
bdconnolly
Regular
Posts: 140
Joined: Tue Apr 04, 2006 9:37 pm

Post 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>
Post Reply