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

Trying to add php script into template

Discussion in 'XenForo Development Discussions' started by i_n_k, Mar 31, 2014.

  1. i_n_k

    i_n_k Member

    I'm trying to add a php variable with output data into the PAGE_CONTAINER template via the Template Modifications "Find and Replace" function and can't seem to figure out how to do it.

    I've done the event listener function for another part which works just fine, and actually set the $phpvariable in that script. Now I'm just trying to use the "find and replace" function to replace this:

    <div id="headerMover">
    <div id="headerProxy"></div>

    <div id="content" class="{$contentTemplate}">
    <div class="pageWidth">
    <div class="pageContent">
    <!-- main content area -->

    with

    <div id="headerMover">
    <div id="headerProxy"></div>

    <div id="content" class="{$contentTemplate}">
    <div class="pageWidth">
    <div class="pageContent">
    <!-- main content area -->
    {$phpvariable}

    but can't seem to get the variable to output here?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    What is output?

    Is the variable available in the template?
    What happens if you dump it using {xen:helper dump, $variable} ?
     
  3. AndyB

    AndyB Well-Known Member

  4. i_n_k

    i_n_k Member

    It initially came up NULL, but I used the below suggestion and that seemed to work after a slight change:

    Thanks to both of you in helping me solve this. Much appreciated :)
     

Share This Page