Jump to content

Template variable that tells me where in the site I am?


snugRugBug

Recommended Posts

Posted

When building plugins, I am sometimes in a situation where I need to attach a template hook somewhere in the global template. This, of course, means that my hook is going to show up everywhere in the site, which is not always what I want. I often want to limit the plugins' display to certain sections of the site only.

This means I need something like this:

{{if $section == 'forum'}}
    {template = 'my_hook'}
{{endif}}

if I want the hook to only show in the forums. What I don't know is how to get that $section variable. What is the best way?

I hope this is simple enough :smile:

Archived

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

  • Recently Browsing   0 members

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