1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MG 1.1 Targeting Media Gallery Pages with Template Conditionals

Discussion in 'Media Gallery Support' started by DeltaHF, Apr 26, 2016.

  1. DeltaHF

    DeltaHF Well-Known Member

    I'm building a heavily customized theme, and I need to display a menu in the header in different areas of the site (it's like a custom version of the tabLinks bar in the default style).

    What is the best way to target all Media Gallery pages (and Resource Manager pages, while we're at it...) with template conditionals?
  2. Chris D

    Chris D XenForo Developer Staff Member

    Best way I can think of, but it applies to both XFMG and XFRM:
    <xen:if is="{$extraTabs.middle.xengallery.selected}">
        // Media tab is selected
    <xen:elseif is="{$extraTabs.middle.resources.selected}" />
        // Resources tab is selected
    There's a small exception to the XFMG one. There's an option to control whether the tab is "home", "middle" or "end", so if you have changed its position you will need to change "middle" to something else accordingly.
    DeltaHF likes this.
  3. DeltaHF

    DeltaHF Well-Known Member

    Perfect! Thanks, Chris.

Share This Page