Jump to content

Show Different Header In Forums


AVSIM.com

Recommended Posts

Posted

Hoping someone can help me edit the globalTemplate to show a different header on the homepage than every other page.


I have a large image on the home page, but don't want to burden the members with having to look at it on every other page.

 

I was thinking a conditional if statement like: if homepage, then HTML for header, else minimal header with just a logo

Posted
 {{if \IPS\Dispatcher::i()->application->default}}
				 <div class='ipsCarousel ipsClearfix slidertall' data-ipsCarousel data-ipsCarousel-maxHeight="500" data-ipsCarousel-showDots data-ipscarousel-slideshow data-ipscarousel-fullSizeItems data-ipscarousel-slideshowTimeout="450" data-interval="5000">
                <ul class='avsim-slide ipsGrid ipsGrid_collapsePhone' data-role="carouselItems">
                <li class="ipsCarousel_item slide1">{template="logo" app="core" group="global" params=""}</li>
                </ul>
            </div>
          					{{if !in_array('ipsLayout_minimal', \IPS\Output::i()->bodyClasses )}}{template="userBar" app="core" group="global" params=""}{{endif}}
{{else}}
          <div class='ipsLayout_container' padding-bottom='20px'>
			{template="logo_min" app="core" group="global" params=""}
{{if !in_array('ipsLayout_minimal', \IPS\Output::i()->bodyClasses )}}{template="userBar" app="core" group="global" params=""}{{endif}}
									</div>
             {{endif}}

Tried it but it also applies to pages and articles.  Anyway to exclude everything but the front page, titled "home" ?

Posted

use this instead 

{{if \IPS\cms\Pages\Page::$currentPage->id == 1}}

	...

{{endif}}

acp > pages > pages > your default page

you can find your page id in address bar when you clicking on edit 

Posted

Perfect.  Ok, almost there.  Now it's showing up on the front page (news) and the individual articles.  That's almost where I want it, except, I don't want to see it when I'm viewing an article.  I take it it's doing this because the article is opening on the "home" page because it uses the same template?  I wonder if I can throw an && in there to omit an article view?

http://www.avsim.com/home/librarynews/saturday-r4015/

 

Thank you!

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...