Show different page banner

I’m trying to show a different banner image (i placed this in the index.tpl file)

only if you’re on a specific page (CMS page I made)…


{if $page="cmspage"}

{else}

{/if}




What am I doing wrong with this statement?



I’ve also tried $page.page_id and $page.page_inner_id.

I’m not too sure exactly what you are trying to do …but the index.tpl pulls in other templates to create the entire “page/site”…so depending on where you are trying to do this you might try the top.tpl or main.tpl…instead of the index.tpl



Do you have a link?

[quote name=‘WebGuy’]I’m not too sure exactly what you are trying to do …but the index.tpl pulls in other templates to create the entire “page/site”…so depending on where you are trying to do this you might try the top.tpl or main.tpl…instead of the index.tpl



Do you have a link?[/QUOTE]





I replaced “top.tpl” because I don’t need it, so I replaced it with a banner image instead. I’m heavily modifying the customer skin.



It works great on every page. All I want is a different banner to show if you’re on a specific CMS page.



I need help with the specific code I posted, because it’s not switching the banner up for the CMS page, so I’m doing something wrong. I need help figuring out how to make that if/then statement work correctly.



Link: [url]http://www.natauto.com/index.php[/url]



Thanks

Anyone have ideas to fix this code?



Thanks

Ok I think I’ve come up with somewhat of a solution…

(nobody laugh 'cause I’m still learning and when the “gurus” see this I know I’m gonna hear about it) :rolleyes:



What I figured was you could set this according to the “title” of the page.



For instance the “Page Title” under CMS > Manage Pages >

Click on a Page and this brings you to “Update Pages” and the Page name is where I believe this is referenced from (not sure).

Hey now I said “don’t laugh”…:smiley:



In your index.tpl file where your “header” is, try this:


```php {if $i.title == “Catalog”}




{else}



{/if} ```

If you have an image that you want for the Catalog page use $i.title == "Catalog"

If you have an image that you want for the About page use $i.title == "About"
or whatever page name you have for it "About our company"...

$i.title = "Page name"

I haven't figured out any other way to "identify" what page you are on...but I'm still working at it.

Let me know how this works for you?

That worked. Awesome job, thank you!!



:slight_smile:



Hey - as long as it works. This will help me out a lot in this current project.

Thanks!

Glad to hear it is working for you…