Page 1 of 1

Static pages and multiple headers

Posted: Wed Jun 25, 2008 4:24 pm
by carl_galloway
First, my apologies if this has been answered somewhere else, I've looked but I don't see anything that obviously stands out.

I'm working on a client site which is using Serendipity, but only for static pages. The website theme has two header, one is very large and only used for the index page, but all the other static pages (eg any static page that doesn't have the homepage option checked) will be using the smaller header.

In index.tpl I just want to be able to test that the page is a homepage, and also a static page, and if it is, then use the big header, otherwise use the small header.

The site also has two languages, English and Hungarian, and I want the Hungarian static page (with homepage checked) to also see the larger header instead of the smaller header.

Can anyone tell me the easiest way to make this happen? Thanks everyone.

Posted: Wed Jun 25, 2008 5:49 pm
by carl_galloway
I hate it when your mind goes blank and you can't figure out how to do something, then you take a break and come back to it and suddenly you remember how to fix it.

Just ignore my little moment of stupidness.

For anyone else who wants to know how to do this, just add this smarty into your index.tpl at the point where you want to make the changes
{if $view == "start"}
big header code
{else}
small header code
{/if}

Posted: Wed Jun 25, 2008 6:41 pm
by Don Chambers
Carl - $view=='start' applies to more than just the start/front page. I thought it also applied to static pages, contact forms, and various other plugin views.. one that came to mind was the download manager plugin. But, perhaps I am wrong.

Another possible method of detecting that front page, is to use the currpage stuff from bulletproof's config.inc.php:

Code: Select all

$serendipity['smarty']->assign(array('currpage'=> "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']));
and then use something like this in the index.tpl:

Code: Select all

{if $currpage==$serendipityBaseURL}
Then again, for all I know, that has limitations too.

Posted: Wed Jun 25, 2008 6:56 pm
by carl_galloway
Hi Don, $view='start' does apply to static pages but thats where I need it, the client actually won't be using the blog at all. That's why s9y is so powerful, it can be used for static multilingual sites. I'm even using the static pages sidebar plugin for my navbar, except I've run into a problem on my local end.

For some reason s9y isn't using apache mod-rewrite on my mamp server and its driving me nuts.