Page 1 of 1

Static pages and sidebars

Posted: Wed Jul 11, 2007 1:41 pm
by Davy
Hi!

I was wondering whether there's a way to include a sidebar in a static page. Or more in common: can one use that kind of Smarty-tags in those pages? If that isn't possible, is there a way to assign a template to a static page? I mean like the way you assign a template to a specific category.

To explain things a bit: I've two parts of my website that run on one Serendipity-installation, so I do sometimes need to tweak the templates a bit and I'd like to do that with the static pages as well.

Re: Static pages and sidebars

Posted: Wed Jul 11, 2007 1:55 pm
by garvinhicking
Hi!

Usually the sidebars are already displayed in static pages?!?

You can use the custom plugin_staticpage.tpl template files to embed sidebars though, using the smarty functions documented here: http://www.s9y.org/78.html

HTH,
Garvin

Re: Static pages and sidebars

Posted: Wed Jul 11, 2007 2:20 pm
by Davy
Yes, they're included, but those are not the ones that I need, since they're the sidebars for the main site instead of those for the subpage. I'll look at the .tpl-file though.

Posted: Thu Jul 12, 2007 1:45 am
by stm999999999
You want to have the sidebar plugins every time on the same place - but on static pages you want to have other plugins as on blog-pages, right?

So, my suggestion:

on new s9y-versions you can config the count and name of sidebars. to do so, edit the config.php of your template:

Code: Select all

$template_config = array( 
    array( 
       'var'     => 'sidebars', 
       'title'   => 'Sidebars', 
       'type'    => 'string', 
       'description'   => 'sidebars', 
       'default' => 'blog-left,hide,blog-right,static-left,static-right' 
     ) 
);
for example.

now you can move the wanted plugins in the right sidebar.

in your index.tpl you have something like

Code: Select all

{serendipity_printSidebar side="right"} 
but we have to know (Garvin!?) if there is a way to look for "is this a static-page?" and then

Code: Select all

{if $is_staticpage} 
{serendipity_printSidebar side="static-right"} 
{else} 
{serendipity_printSidebar side="blog-right"} 
{/if} 
But be aware: perhaps some sidebar-plugins are of the only-once-type. These cannot occurs on both sidebar-types.

Posted: Thu Jul 12, 2007 10:46 am
by Davy
I use this method for my different categories, but I'm not sure how to tell S9Y to place a sidebar only on one sidebar.