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

Dynamic Navbar Link

Discussion in 'XenForo Development Discussions' started by viaBowl, Aug 19, 2013.

  1. viaBowl

    viaBowl Member

    Here's one I'm stumped on:

    Where is the BEST place to put a custom function that will return a user-unique URL that will be placed in the navbar.

    Basically, I am going to add my navbar link in the template, but I want to use a callback to generate the href.

    Any advice is appreciated :)
  2. JulianD

    JulianD Well-Known Member

    Use the <xen:callback> tag wherever you want in a template. The callback tag receives the name of the class that should be called. For example, a class name could be


    The actual class file should be places inside the library directory with the same directory structure as the name of the class you are calling on the callback tag:


    Read more about it here: http://xenforo.com/community/resources/xen-callback-tag.2027/
  3. viaBowl

    viaBowl Member

    I just discovered this after I posted. The direct callback from a template is awesome! I wonder how resource heavy it would be for bigger calls.
  4. JulianD

    JulianD Well-Known Member

    You can always implement some sort of caching system if your callbacks are big enough to worry about them.

Share This Page