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

Using variables in templates

$bro.guide

  1. Brogan

    Brogan XenForo Moderator Staff Member

    Brogan submitted a new resource:

    Using variables in templates - $bro.guide

    Read more about this resource...
     
  2. wang

    wang Well-Known Member

    Excellent guide sir.

    I tried to rate it and leave a review too, but the Submit button was greyed out and it could not be submited.
     

    Attached Files:

  3. Brogan

    Brogan XenForo Moderator Staff Member

    Did you write some comments in the Review field?

    The button should become active once you reach the minimum character count, which is currently 100.
     
  4. wang

    wang Well-Known Member

    Yes sir. I wrote this review.

    Excellent guide sir. Thank you for posting it.

    Edit. I saw where the problem was. I lengthened the review and now it was posted.
     
    Last edited: Feb 3, 2016
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Brogan updated Using variables in templates with a new update entry:

    Setting values in the container

    Read the rest of this update entry...
     
    resonansER and wang like this.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Brogan updated Using variables in templates with a new update entry:

    Calling variables in phrases

    Read the rest of this update entry...
     
    wang likes this.
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Brogan updated Using variables in templates with a new update entry:

    Calling Options & Style Properties in templates

    Read the rest of this update entry...
     
  8. woody

    woody Member

    Excellent guide...have been using this with DFP variables to call specific ads based on template, visitor ID and others.

    Question: is there a variable that notes the canonical URL? I'm working on some new targeting options for DFP and it would be very useful to pull that specific information.

    Thank you @Brogan :)
     
  9. woody

    woody Member

    Still seeking a means of dynamically passing the page URL into DFP for targeting purposes...
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    I don't really understand what it is you're after but there's unlikely to be a variable for it.
     
  11. Sean Kendle

    Sean Kendle Member

    Something like this?
    Code:
    <script>
    
        var strCurrentPage = "{$contentTemplate}";
        googletag.pubads().setTargeting("page",strCurrentPage);
       
        <xen:if is="{$forum.node_id} != 0">
            // if not homepage, send forum id:
            googletag.pubads().setTargeting("forumid","{$forum.node_id}");
       </xen:if>
    
    
    </script>
    
     
  12. Sean Kendle

    Sean Kendle Member

    You can also get the current URL using javascript and pass that in, that's not really a XenForo thing, though.
     

Share This Page