Announcement

Collapse
No announcement yet.

Using javascript and vbulletin variables in template

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trommsdorff
    replied
    OK - bump. Desperate for help here!

    Leave a comment:


  • Trommsdorff
    started a topic Using javascript and vbulletin variables in template

    Using javascript and vbulletin variables in template

    Hello,

    I made a template called sidebar and reference it successfully using $sidebar. I successfully included it into the site and it does what I need it to do.

    Here's an example of the first HTML section in $template:

    Code:
     
    <table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="$stylevar[tablewidth]" align="center">
    However, in this template, it draws a column with some includes from a sister site. However, I want it to not draw the column if the screen width is 800 or lower.

    So, I changed the first line to this:

    Code:
     
    <script type="text/javascript"><!--
    if (screen.availwidth>800) {
    document.write("<table cellpadding=\”$stylevar[outerborderwidth]\” cellspacing=\”0\” border=\”0\” class=\”tborder\” width=\”$stylevar[tablewidth]\” align=\”center\”>");
    REST OF CODE HERE
    }
    else;
    //--></script>
    Now, it's like Vbulletin doesn't include it at all. It's not drawn on the HTML display, it's not in the source code, there are no JS errors, it's like VB just doesn't include it. $sidebar is located in a <td></td> section, and in that section there is nothing in the source code.

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