• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
      • Try XenForo Demo
      • New Posts
      • FAQ
      • Calendar
      • Community
        • Groups
        • Albums
        • Member List
      • Forum Actions
        • Mark Forums Read
      • Quick Links
        • Today's Posts
        • Who's Online
      • Sponsor
        • Sponsor a Feature
        • List of Donors
    • Wiki
    • Support
    • What's New?
    • Buy Now
    • Manual
    • 
    • Forum
    • VaultWiki How-Tos
    • VaultWiki Questions
    • Whitespace when using templates

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Results 1 to 8 of 8

    Thread: Whitespace when using templates

    • Thread Tools
      • Show Printable Version
    1. April 3, 2010 #1
      Kaelon
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Kaelon is offline
      Regular Member
      Join Date
      June 17, 2008
      Posts
      116
      Rep Power
      201

      Whitespace when using templates

      I have noticed that when I include Templates, a great deal of white/blank space is included before the template itself is inserted. Am I using the templates incorrectly? Is there something that I should be doing to make sure that my templates are being included properly? The layout/format is pretty sloppy, and I definitely want it to be smooth/flush.
      Reply With Quote Reply With Quote

    2. April 3, 2010 #2
      Mokonzi
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      Mokonzi is offline
      Senior Member
      Join Date
      January 19, 2009
      Location
      South West Scotland
      Posts
      158
      Rep Power
      198
      Can you post an example of one of your templates?
      Reply With Quote Reply With Quote

    3. April 3, 2010 #3
      Kaelon
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Kaelon is offline
      Regular Member
      Join Date
      June 17, 2008
      Posts
      116
      Rep Power
      201
      Of course. This is one of my templates:

      http://www.aelyria.com/wiki/Template:Stub

      But here is how it looks when it is included in an article:

      http://www.aelyria.com/wiki/Interregnum

      Notice how the added white-space and grey-space is included, even though in the source there are no carriage returns or added whitespace. This behavior happens anytime I use the TEMPLATE bbcode.
      Reply With Quote Reply With Quote

    4. April 3, 2010 #4
      Kaelon
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Kaelon is offline
      Regular Member
      Join Date
      June 17, 2008
      Posts
      116
      Rep Power
      201
      Here's another example of a more complicated template.

      http://www.aelyria.com/wiki/Template:Spellbox

      And here is how it renders (notice the HUGE blankspace before it is inserted/parsed):

      http://www.aelyria.com/wiki/Summon_Angel
      Reply With Quote Reply With Quote

    5. April 3, 2010 #5
      Mokonzi
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      Mokonzi is offline
      Senior Member
      Join Date
      January 19, 2009
      Location
      South West Scotland
      Posts
      158
      Rep Power
      198
      It looks like it's to do with your BBCodes [box] and [frame]. What is the coding for those within the BBCode manager?

      Note how Pegasus has developed a template here: [template]Warning Box[/template]
      Reply With Quote Reply With Quote

    6. April 3, 2010 #6
      Kaelon
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Kaelon is offline
      Regular Member
      Join Date
      June 17, 2008
      Posts
      116
      Rep Power
      201
      Strange - they render just fine in posts, and were working just fine in NuWiki without the added carriage returns/etc. Here's the coding.

      For [box]:

      Code:
      <table cellpadding="5" align="{option}">
      <tr><td><table border="0" cellpadding="1" cellspacing="0" class="tborder">
        <tr>
          <td><table width="100%" border="0" cellpadding="10" cellspacing="0">
            <tr>
              <td class="alt2">{param}</td>
            </tr>
          </table></td>
        </tr>
      </table>
      </td></tr>
      </table>
      For [frame]:

      Code:
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="{option}">
                        <tr>
                          <td width="12" height="12"><img src="/images/ui/border-topleft.gif" width="12" height="12" /></td>
                          <td width="99%" height="12" background="/images/ui/border-topmid.gif"><img src="/images/pixel.gif" width="1" height="1" /></td>
                          <td width="12" height="12"><img src="/images/ui/border-topright.gif" width="12" height="12" /></td>
                        </tr>
                        <tr>
                          <td width="12" background="/images/ui/border-leftmid.gif">&nbsp;</td>
                          <td>{param}</td>
                          <td width="12" background="/images/ui/border-rightmid.gif">&nbsp;</td>
                        </tr>
                        <tr>
                          <td width="12" height="12"><img src="/images/ui/border-botleft.gif" width="12" height="12" /></td>
                          <td width="99%" height="12" background="/images/ui/border-botmid.gif"><img src="/images/pixel.gif" width="1" height="1" /></td>
                          <td width="12" height="12"><img src="/images/ui/border-botright.gif" width="12" height="12" /></td>
                        </tr>
                      </table>
      Reply With Quote Reply With Quote

    7. April 3, 2010 #7
      Kaelon
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      Kaelon is offline
      Regular Member
      Join Date
      June 17, 2008
      Posts
      116
      Rep Power
      201
      I just figured it out. Apparently, the VaultWiki bbcode parser is interpreting carriage returns in the HTML Replacement for a BBcode as actual carriage returns to be processed in a post/article. This is strange behavior and not how posts parse BBcodes. I was able to change my [box] bbcode to be a single line of HTML (with no carriage returns for added readability formatting), and that completely fixed the issue on my end.

      I've submitted a bug to see if this can be fixed. I would be bummed to have to rewrite all of my BB Codes.
      Reply With Quote Reply With Quote

    8. April 3, 2010 #8
      Mokonzi
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      Mokonzi is offline
      Senior Member
      Join Date
      January 19, 2009
      Location
      South West Scotland
      Posts
      158
      Rep Power
      198
      That would explain it. White space is added in templates, something to watch for. Templates are parsed differently because they can contain the [if] commands.

      When using the table BBCode in VW, make sure you add a SPACE rather than a carriage return. Often in templates if something isn't lookig the way you expect, it can be extra spaces.

      It might be an idea to consider creating a new template that replicates what you want.

      For example, your Box BBCode could be adjusted to:

      Code:
      [table] cellpadding="5" align="{{{align}}}">
      |-
      | style="border:1px;padding:1px" | 
      [table] width="100%" border="0" cellpadding="10px" cellspacing="0"
      |-
      | class="alt2" | {{{content}}}
      [/table][/table]
      The advantage of this is that you will be able to add more options in if you want, such as width, padding, etc. The above template would be exectuted as:

      [template]MyTemplate
      | align=center
      | content=My content.
      [/template]

      If you do choose to use other style classes in your table commands, make sure you check out this thread on how to do it: Adding Additional CSS Classes.
      Reply With Quote Reply With Quote

    Similar Threads

    1. <BR's> between templates
      By SurferJon in forum VaultWiki Questions
      Replies: 7
      Last Post: March 25, 2016, 6:18 PM
    2. How to Use Templates
      By bazaarocommunity in forum VaultWiki Questions
      Replies: 3
      Last Post: September 24, 2015, 4:31 PM
    3. Templates
      By JesterP in forum General Discussion
      Replies: 5
      Last Post: April 8, 2012, 6:21 PM
    4. Templates - How to use them and what I need out of them
      By Alan_SP in forum VaultWiki Questions
      Replies: 8
      Last Post: March 31, 2011, 3:20 AM
    5. Templates
      By iamacyborg in forum General Discussion
      Replies: 4
      Last Post: July 31, 2010, 4:42 PM

    Tags for this Thread

    able, added, align, all, another, any, are, because, before, being, blank, border, can, check, class, com, completely, consider, could, deal, doing, example, explain, format, great, has, have, here, how, http, iced, include, layout, line, looks, make, more, notice, one, other, out, pegasus, post, pre, properly, rewrite, see, should, single, some, something, source, space, stub, sure, template, templates, that, the, there, using, was, way, were, when, white, whitespace, wiki, within, without, would, www, you, your

    View Tag Cloud

    Bookmarks

    Bookmarks
    • Submit to Digg Digg
    • Submit to del.icio.us del.icio.us
    • Submit to StumbleUpon StumbleUpon
    • Submit to Google Google

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    • BB code is On
    • Smilies are On
    • [IMG] code is Off
    • [VIDEO] code is
    • HTML code is Off

    Forum Rules

    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 2:30 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.