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.
Static pages and sidebars
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Static pages and sidebars
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
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/
# 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/
Re: Static pages and sidebars
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:
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:
for example.
now you can move the wanted plugins in the right sidebar.
in your index.tpl you have something like
but we have to know (Garvin!?) if there is a way to look for "is this a static-page?" and then
But be aware: perhaps some sidebar-plugins are of the only-once-type. These cannot occurs on both sidebar-types.
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'
)
);
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"}
Code: Select all
{if $is_staticpage}
{serendipity_printSidebar side="static-right"}
{else}
{serendipity_printSidebar side="blog-right"}
{/if} Ciao, Stephan