Page 1 of 2

deactivation of sidebar plugin

Posted: Sat Jan 07, 2006 1:27 pm
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.

Re: deactivation of sidebar plugin

Posted: Sat Jan 07, 2006 6:14 pm
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

Posted: Sun Jan 08, 2006 11:08 am
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}

Posted: Sun Jan 08, 2006 2:35 pm
by garvinhicking
You did alter your static page and rename the one you want to hide to "specialpage", right?

Regards,
Garvin

Posted: Sun Jan 08, 2006 3:33 pm
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

Posted: Sun Jan 08, 2006 3:49 pm
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

Posted: Sun Jan 08, 2006 4:43 pm
by Meinhard
I think you mean the ACP configuration?

Image

Posted: Sun Jan 08, 2006 4:55 pm
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

Posted: Sun Jan 08, 2006 5:01 pm
by Meinhard
you are great. many thanks!!

Posted: Tue Jan 24, 2006 11:39 am
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!

Posted: Tue Jan 24, 2006 11:47 am
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

Posted: Tue Jan 24, 2006 12:33 pm
by Henn1
wow - pretty fast!
thnax a lot!

Posted: Sun Jul 16, 2006 8:12 am
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?

Posted: Mon Jul 17, 2006 11:33 am
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

Posted: Mon Jul 17, 2006 3:12 pm
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