A way to do <vb:literal> in vBulletin 3.8.x?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xlguy
    Senior Member
    • Jan 2002
    • 148

    A way to do <vb:literal> in vBulletin 3.8.x?

    We are trying to put some Google DFP asynchronous tags on to our 3.8.7 forum, but it's not working because vB is parsing the tags. In vb4 they introduced <vb:literal>code</vb:literal> which treats the code within the tags as being HTML. Is there a tag like that in 3.8? Or is there a relatively easy way to get the same effect? (i.e. to stop vB from parsing some code).

    Thanks
    xlguy
  • Matthew Gordon
    Senior Member
    • May 2002
    • 3243
    • 1.1.x

    #2
    No, there isn't a literal tag in vB3, mainly because there weren't many tags at all that were parsed for templates. <if>, <else>, and <phrase> is all I can think of.

    What code is it trying to parse?

    Comment

    • xlguy
      Senior Member
      • Jan 2002
      • 148

      #3
      Thanks for the reply Matt. I'm trying to use some code from Google, which is meant to go between your <head> tags:

      HTML Code:
      <script type='text/javascript'>
      var googletag = googletag || {};
      googletag.cmd = googletag.cmd || [];
      (function() {
      var gads = document.createElement('script');
      gads.async = true;
      gads.type = 'text/javascript';
      var useSSL = 'https:' == document.location.protocol;
      gads.src = (useSSL ? 'https:' : 'http:') + 
      '//www.googletagservices.com/tag/js/gpt.js';
      var node = document.getElementsByTagName('script')[0];
      node.parentNode.insertBefore(gads, node);
      })();
      </script>
      
      <script type='text/javascript'>
      googletag.cmd.push(function() {
      googletag.defineSlot('/100XX/160sky', [160, 600], 'div-gpt-ad-XX-0').addService(googletag.pubads());
      googletag.defineSlot('/100XX/728-90-inpost', [728, 90], 'div-gpt-ad-XX-1').addService(googletag.pubads());
      googletag.defineSlot('/100XX/728x90', [728, 90], 'div-gpt-ad-XX-2').addService(googletag.pubads());
      googletag.defineSlot('/100XX/468banner', [468, 60], 'div-gpt-ad-XX-3').addService(googletag.pubads());
      googletag.pubads().enableSingleRequest();
      googletag.enableServices();
      });
      </script>
      Then, to display an ad (such as the 160sky) you put this within the page body:

      HTML Code:
      <div id='div-gpt-ad-XXXX-0' style='width:160px; height:600px;'>
      <script type='text/javascript'>
      googletag.cmd.push(function() { googletag.display('div-gpt-ad-XX-0'); });
      </script>
      </div>
      For some reason that doesn't work (i.e. putting the first block of code in headerinclude and the 2nd one in a template like showthread).

      I've seen people reporting issues with similar code (asynchronous JS) and they got it to work by wrapping it in the new {vb:literal} tags. Hence my question
      xlguy

      Comment

      • Matthew Gordon
        Senior Member
        • May 2002
        • 3243
        • 1.1.x

        #4
        The reason vb:literal tags are sometimes needed is because sometimes JavaScript trips up the template compiler, as far as I know. When I add that to my headinclude template, it spits it out exactly as it should, so even if there were vb:literal tags in vB 3.8, they wouldn't do anything in this case.

        Comment

        • Paul M
          Former Lead Developer
          vB.Com & vB.Org
          • Sep 2004
          • 9886

          #5
          Just use html comments

          <!--

          your stuff here

          -->
          Baby, I was born this way

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...