XF 2.0 Macros - need help

Russ

Well-known member
I'm trying to turn the visitor tabs ("p-nav-opposite") into a simple macro so I can call them in various places.

I figured you could wrap the contents:

Code:
<xf:macro name="visitortabs"> p-nav-opposite content here</xf:macro>

Then call it via:

Code:
<xf:macro name="visitortabs" />

While this appears to work, for the most part, it breaks the search menu by not having the additional search options(search this thread).
 
Basically use something like this wherever you want to use the macro
Code:
<xf:macro template="pls_buff_mccree" name="visitortabs" arg-searchConstraints="{$searchConstraints}" />
and this inside the actual macro template
HTML:
<xf:macro name="visitortabs" arg-searchConstraints="!">
    <div class="p-nav-opposite">
and pass all the page options or data that is only available in the PAGE_CONTAINER template (I think?)
 
Basically use something like this wherever you want to use the macro
Code:
<xf:macro template="pls_buff_mccree" name="visitortabs" arg-searchConstraints="{$searchConstraints}" />
and this inside the actual macro template
HTML:
<xf:macro name="visitortabs" arg-searchConstraints="!">
    <div class="p-nav-opposite">
and pass all the page options or data that is only available in the PAGE_CONTAINER template (I think?)

If all the locations would be inside page_container would I still need to pass the variables? Essentially it's moving the user nav in different parts of the PAGE_CONTAINER. I guess I'm a little confused by what variables need to be passed through.
 
Back
Top Bottom