Static pages and multiple headers

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Static pages and multiple headers

Post by carl_galloway » Wed Jun 25, 2008 4:24 pm

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.

carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway » Wed Jun 25, 2008 5:49 pm

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}

User avatar
Don Chambers
Regular
Posts: 3638
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers » Wed Jun 25, 2008 6:41 pm

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.

carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway » Wed Jun 25, 2008 6:56 pm

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.

Post Reply