solved Replicating Lucid Banner to New Pages

alt=
Tatiana Dokuchic
@tatiana-dokuchic
8 years ago
83 posts
I'm using the Lucid skin.

I would like the banner that currently appears on the Lucid home page to also appear on selected new pages that I create using Site Builder. What's the best way to do this?

Thanks!
updated by @tatiana-dokuchic: 12/22/16 06:37:45PM
paul
@paul
8 years ago
4,326 posts
To see how this works in the Lucid skin, let's first take a look at the skin's index.tpl template. On line 1 we have -
{jrCore_include template="header.tpl" show_bg=1}
This is including the header.tpl template and passing the variable $show_bg to it, so let's now look at the header.tpl template. Starting line 28 we have -
{if $show_bg == 1}
    <div class="banner"></div>{else}
    <div class="spacer"></div>{/if}
See that this code is testing for the $show_bg variable and if set, shows the banner (its part of the class statement), if not, if just sticks a spacer in.

So, if you where developing your site by editing the templates directly you could just include this variable in the 'include header' call for the template pages where you want it to show.
But you are using SiteBuilder which uses a common header.tpl (and footer.tpl) throughout, so in this case I'd suggest replacing the header template code with this -
{if $_post.module_url == 'page1' || $_post.module_url == 'page2' || $_post.module_url == 'page3'}
    <div class="banner"></div>{else}
    <div class="spacer"></div>{/if}
where page1, page2 and page3 are the page urls, so this will show the banner on those pages.
hth
Pa


--
Paul Asher - JR Developer and System Import Specialist
alt=
Tatiana Dokuchic
@tatiana-dokuchic
8 years ago
83 posts
Sounds like a plan, Paul.

Now where would I go to find the common header.tpl code that should be replaced?

I've looked around but haven't found it. Being a newbie really sucks sometimes :)
derrickhand300
@derrickhand300
8 years ago
1,353 posts
I think it should be in the LUCID skin>Templates>header.tpl
alt=
Tatiana Dokuchic
@tatiana-dokuchic
8 years ago
83 posts
Thanks, Derrick!

I was making it too complicated and looking for another template besides that one. No wonder I couldn't find it ;)

@Paul - it looks good! Thanks :)


ETA: For other newbies that might want to use this.

Check out "Reading The $_post" @
https://www.jamroom.net/ultrajam/documentation/code/1683/reading-the-post
to see exactly what $_post.module_url returns.

My code ended up as follows:

{if $_post.module_url == NULL || $_post.module_url == 'test'}
    <div class="banner"></div>{else}
    <div class="spacer"></div>{/if}

NULL is for "http://mysite.com"
test is for "http://mysite.com/test"

Cheers!
updated by @tatiana-dokuchic: 09/22/16 03:17:20PM