deactivation of sidebar plugin

Creating and modifying plugins.
Meinhard
Regular
Posts: 36
Joined: Mon Jul 25, 2005 9:25 pm

deactivation of sidebar plugin

Post by Meinhard »

is it possible to deactivate/ disable the sidebar for e. g. a static page or for the iframe plugin (WRAPURL). Many thanks for any help.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: deactivation of sidebar plugin

Post by garvinhicking »

Yes, you could edit your index.tpl template and use a code like:

Code: Select all

{if $staticpage_title != 'specialpage'}
...
here the code for showing sidebarvia Smarty
...
{/if}
Then the smarty code call to create the sidebar plugins will onlybe executed when the staticpage called 'specialpage' is NOT being called.

Of course, having sidebars and the usual s9y layout is one of the reasons why you use a staticpage instead of a HTML page unrelated to serendipity :)

HTH,
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/
Meinhard
Regular
Posts: 36
Joined: Mon Jul 25, 2005 9:25 pm

Post by Meinhard »

many thanks garvin, but the sidebar does not disappear.

Code: Select all

{if $is_raw_mode != true}
<div id="serendipity_banner">
    <h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default:$blogTitle}</a></h1>
    <h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogDescription}</a></h2>
    <div id="navigation">
        <ul>
            <li class="nav1"><a href="{$serendipityBaseURL}" title="Weblog" accesskey="1">Blog</a></li>
            <li class="nav2"><a href="{$serendipityBaseURL}index.php?/pages/about.html" title="About" accesskey="2">About</a></li>
            <li class="nav3"><a href="{$serendipityBaseURL}gall/index.php" title="Bilder" accesskey="3"><b>Bilder</B></a></li>
            <li class="nav4"><a href="{$serendipityBaseURL}pages/contactform.html" title="Kontakt" accesskey="4"><b>Kontakt</b></a></li>
        </ul>
    	</div>
    <br style="clear: both" />
</div>
<table id="mainpane">
    <tr>
{if $staticpage_title != "specialpage"}
{if $leftSidebarElements > 0}
        <td id="serendipityLeftSideBar" valign="top">{serendipity_printSidebar side="left"}</td>
{/if}
{/if}
        <td id="content" valign="top">{$CONTENT}</td>
{if $staticpage_title != "specialpage"}
{if $rightSidebarElements > 0}
        <td id="serendipityRightSideBar" valign="top">{serendipity_printSidebar side="right"}</td>
{/if}
{/if}
    </tr>
</table>
{/if}
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

You did alter your static page and rename the one you want to hide to "specialpage", right?

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/
Guest

Post by Guest »

garvinhicking wrote:You did alter your static page and rename the one you want to hide to "specialpage", right?

Regards,
Garvin
yes - I tried It with different names and last time with .../pages/specialpage.html
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

That would be the URL which you're trying to configure? Please make a screenshot of the staticpage edit panelwhere you try to call your page "specialpage".

Bestregards,
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/
Meinhard
Regular
Posts: 36
Joined: Mon Jul 25, 2005 9:25 pm

Post by Meinhard »

I think you mean the ACP configuration?

Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I am sorry, I made a spelling mistake. Instead of "$staticpage_title" you must use "$staticpage_pagetitle" in your index.tpl template!

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/
Meinhard
Regular
Posts: 36
Joined: Mon Jul 25, 2005 9:25 pm

Post by Meinhard »

you are great. many thanks!!
Henn1

Post by Henn1 »

Hi Gents,

I tried to do the same and it worked perfectly!
But I´d like to deactivate the sidebar on more than only one static page.

I tried to do stuff like:

Code: Select all

{if $staticpage_title != 'specialpage' or if if $staticpage_title != 'specialpage2'}
...
here the code for showing sidebarvia Smarty
...
{/if}
but it didn´t work. Well I´m not too familiar with php...

How can I achieve this?

Thanx for any help!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

If you read smarty.php.net documentation, you'll find that you would require this code:

Code: Select all

{if $staticpage_title != 'specialpage' AND $staticpage_title != 'specialpage2' AND $staticpage_title != 'specialpage3'}
...
here the code for showing sidebarvia Smarty
...
{/if}
:-)

Best 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/
Henn1

Post by Henn1 »

wow - pretty fast!
thnax a lot!
jojje
Regular
Posts: 41
Joined: Thu Dec 08, 2005 4:09 pm
Location: Sweden
Contact:

Post by jojje »

If one uses the wrapurl-plugin, can one use a simular code like this to turn off the sidebar?

What shall one check for instead of $staticpage_pagetitle?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

The wrapurl plugin did not yet support this. I added this in version 0.3 of the plugin, then you can also check $staticpage_pagetitle there.

The updated version should show up in spartacus in < 48 hours, or you can get it from here a bit sooner:

http://php-blog.cvs.sourceforge.net/*ch ... rapurl.php

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/
jojje
Regular
Posts: 41
Joined: Thu Dec 08, 2005 4:09 pm
Location: Sweden
Contact:

Post by jojje »

I get this error with the new version

Code: Select all

Parse error: parse error, unexpected T_ECHO in /data/members/paid/p/a/paloma-parra.com/htdocs/www/paloma/plugins/serendipity_event_wrapurl/serendipity_event_wrapurl.php on line 132
Post Reply