Static pages and sidebars

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

Static pages and sidebars

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

Re: Static pages and sidebars

Post 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
# 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/
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

Re: Static pages and sidebars

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

Post 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.
Ciao, Stephan
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

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