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

Dynamic Navbar Link

#1
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 :)
 

JulianD

Well-known member
#2
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

YourCompany_CallBacks_YourClass


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:

YourCompany/CallBacks/YourClass.php

Read more about it here: http://xenforo.com/community/resources/xen-callback-tag.2027/
 
#3
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.