• 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
    • <BR's> between 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: <BR's> between templates

    • Thread Tools
      • Show Printable Version
    1. March 25, 2016 #1
      SurferJon
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      SurferJon is offline
      Junior Member
      Join Date
      November 7, 2015
      Posts
      21
      Rep Power
      129

      <BR's> between templates

      When I do something like this:

      [template][/template]
      [template][/template]
      [template][/template]
      [template][/template]

      It outputs this in the HTML:
      [template][/template]<br />
      [template][/template]<br />
      [template][/template]<br />
      [template][/template]<br />

      I could do this to avoid the <br>'s...
      [template][/template][template][/template][template][/template][template][/template]

      ...but it looks messy in the editor.

      Is it possible to change the coding of Vaultwiki so that if there's only a line break between two templates, it ignores them and doesn't add any <br's>?

      Thank you!
      Reply With Quote Reply With Quote

    2. March 25, 2016 #2
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      688
      Please PM me a link to the page where this happens. Other factors might be affecting this.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    3. March 25, 2016 #3
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      688
      Okay, so it's not outputting the raw BR tags, but the line breaks are converted to BR.

      This is expected behavior. XenForo does this in regular posts too.

      To get around this without putting everything on the same line, try a system like:
      Code:
      [template][/template][comment]
      [/comment][template][/template][comment]
      [/comment][template][/template]
      If the line breaks are trapped in a comment, they won't be used in the final output.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    4. March 25, 2016 #4
      SurferJon
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      SurferJon is offline
      Junior Member
      Join Date
      November 7, 2015
      Posts
      21
      Rep Power
      129
      Quote Originally Posted by pegasus View Post
      Okay, so it's not outputting the raw BR tags, but the line breaks are converted to BR.

      This is expected behavior. XenForo does this in regular posts too.

      To get around this without putting everything on the same line, try a system like:
      Code:
      [template][/template][comment]
      [/comment][template][/template][comment]
      [/comment][template][/template]
      If the line breaks are trapped in a comment, they won't be used in the final output.
      Unfortunately that's still messy for my purposes and what I'm trying to avoid. Is there a line I could change in the VW installation to ignore everything between [/template and [template], or to ignore the line breaks in those cases? It's okay if I have to update it every time I upgrade.

      Thank you!
      Reply With Quote Reply With Quote

    5. March 25, 2016 #5
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      688
      Make a Code Event Listener for event location load_class and also for load_class_bb_code. Your listeners should have a Callback Execution Order of 10001, class name MyAddon_MyListenerClass (library/MyAddon/MyListenerClass.php), method load_class, and it should look like:
      Code:
      class MyAddon_MyListenerClass
      {
      	public static function load_class($class, &$extend)
      	{
      		if ($class == 'XenForo_BbCode_Parser')
      		{
      			$extend[] = 'MyAddon_MyClass';
      		}
      	}
      }
      In this example, your custom BB-Code class would be stored in library/MyAddon/MyClass.php, and it should look like:
      Code:
      class MyAddon_MyClass extends XFCP_MyAddon_MyClass
      {
      	public function vwGetWikiTagDefinitions()
      	{
      		$tags = parent::vwGetWikiTagDefinitions();
      		$tag = vw_Hard_Core::model('Tag')->get_tag_name('vw_template_tag');
      
      		if (isset($tags["$tag"]))
      		{
      			$tags["$tag"]['trimLeadingLinesAfter'] = 1;
      		}
      
      		return $tag;
      	}
      }
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    6. March 25, 2016 #6
      SurferJon
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      SurferJon is offline
      Junior Member
      Join Date
      November 7, 2015
      Posts
      21
      Rep Power
      129
      Thank you so much for the response!

      I'm getting an error when I try to do it. Am I doing something wrong?

      http://imgur.com/zw7iznn
      Attached Images Attached Images
      • File Type: jpg codeeventlistener.jpg (10.5 KB, 7 views)
      Reply With Quote Reply With Quote

    7. March 25, 2016 #7
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      688
      Did you create the files yet? The form checks that the files exist and contain the classes you say.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    8. March 25, 2016 #8
      SurferJon
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      SurferJon is offline
      Junior Member
      Join Date
      November 7, 2015
      Posts
      21
      Rep Power
      129
      Oops, I didn't do it in the right order, thank you!

      But now when I try to save I get: "The server responded with an error. The error message is in the JavaScript console."

      Ugh...
      Reply With Quote Reply With Quote

    Similar Threads

    1. GUI Templates
      By bazaarocommunity in forum Ideas & Suggestions
      Replies: 0
      Last Post: October 16, 2015, 6:05 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

    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 1:21 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 © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.