Seperate header or footer

infinityssm
infinityssm
@makande
8 years ago
53 posts
Hi,
I'm having JavaScript conflict issues so I want to try and seperate the footers needed to render certain pages. How can I setup different footers for different pages.

Thanks
updated by @makande: 03/14/17 10:19:35PM
michael
@michael
8 years ago
7,714 posts
you can use an {if} statement for the different footer content, or if you REALLY need them in different files, use an {if} with a {jrCore_include} in it.
{if .....}
// first footer here
{else}
// Second footer here
{/if}

Docs: "Template Blocks"
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-developers-guide/3126/template-blocks
infinityssm
infinityssm
@makande
8 years ago
53 posts
Thanks Michael,

I tried several different {if} statements like the sample you provided above. However non of my scripts worked. Is there a specific {if} statement that I can use, like for page title.

For example on the events module the JavaScript needed to render the events lists is different from what I need for the calendar page.

So what {if} statement could I use for the calendar.tpl page.

Thanks
michael
@michael
8 years ago
7,714 posts
Too vague, need more info. Templates are a language, they do whatever you want them to do, so you need to say what you want to do.

"I want to write a book, which words come first?" is difficult to answer.
infinityssm
infinityssm
@makande
8 years ago
53 posts
Two of the template pages in the events module use the same footer. I would like to use seperate footers for the list.tpl and the page that renders the calendar.

I tried several different {if} statements like the sample you provided above. However non of my scripts worked.

So what {if} statement could I use to render a seperate footer for the calendar.tpl page.

Thanks
paul
@paul
8 years ago
4,326 posts
Start by putting a {debug} in the footer.tpl. When viewed you'll get a popup of all the smarty parameters available to you in this template. Have a look through them to see what is unique to the pages you want to test for. Check the $_post array to start with. You can then include those variables in your if statement -

{if $_post.xxxx == 'whatever'}
Code
{elseif $_post.xxxx == 'something_else'}
Different Code
{/if}

Hope that helps

--edit--
adjusting code typo from = to ==
= is an assigning operator
== is a comparison checker


--
Paul Asher - JR Developer and System Import Specialist
infinityssm
infinityssm
@makande
8 years ago
53 posts
Thanks Paul,

This is great information.