making pagelayout.tpl adjust for specific pages

making pagelayout.tpl adjust for specific pages

Friday 07 May 2004 2:24:12 pm - 3 replies

Author Message

Vivek Chopra

Friday 07 May 2004 2:43:30 pm

Brian,

Create sections for "Home", "About Us", "Services" and all other parts of the website and then use a case statement in pagelayout.tpl to check the section and display the correct image name. You can get the section in your pagelayout.tpl through $DesignKeys:used.section

I hope this helps. I am also on my first ezpublish site.

Vivek

William Gourlie

Friday 07 May 2004 3:20:05 pm

Very much appreciated. Good luck on your site!

-Brian

Conor Murray

Monday 10 May 2004 5:50:59 am

Here's an easy way to work around your problem... use pagelayout.tpl for every page EXCEPT the home page and override it for the home page. The home page is node 2 by default.

You can also embed code in your pagelayout.tpl to display different images etc. in different sections of the site, like this:

{let cursect=$module_result.section_id}
{switch name=sw1 match=$cursect}
  {case match=3}
    <img src={"pict_camp.jpg"|ezimage} alt="picture" width="160" height="147" />
  {/case}
  {case match=4}
    <img src={"pict_hre.jpg"|ezimage} alt="picture" width="160" height="147" />
  {/case}
  {case match=5}
    <img src={"pict_youth.jpg"|ezimage} alt="picture" width="160" height="147" />
  {/case}
...
  {case}
    <img src={"pict_search.jpg"|ezimage} alt="picture" width="160" height="147" />
  {/case}
{/switch}
...
{/let}

The 'case' without 'match' is the default case.

HTH,
Conor Murray

Language is a virus - William S Burroughs

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.