Replacement Variables 
Replacement Variables are chunks of text that are replaced with alternative text by the system before being displayed on screen.

One use for replacement variables is to correct common spelling mistakes. For example, on the vBulletin Community Forums a replacement variable exists to replace all instances of the incorrect abbreviation for vBulletin “VBB” with the correct abbreviation “vB”.

Replacement variables can be used to insert commonly-used blocks of HTML.

For example, a replacement variable could be set up to replace <tablestart> with <table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">.

As another example, your templates could contain blocks of code like this:
    <td class="alt1">Cell contents...</td>
Before being displayed in a visitor's browser, the replacement variable system would identify the <tablestart> replacement variable and replace it with the following:
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
    <td class="alt1">Cell contents...</td>
Replacement variables in vBulletin are case insensitive, meaning that a replacement variable set to replace for word will also replace Word, wOrD and WORD.

The replacement variable system is activated in the last stages of page processing before the HTML is delivered to a visitor's browser. The system searches for target text in the completed, parsed templates.
Replacement can be useful, but replacement variables can break the functionality of your site if used incorrectly.
For example, if you create a replacement variable to search for html and replace it with HTML, any hyperlinks pointing to files with a .html suffix will have those links replaced with .HTML, which is not the same file on a Unix web server, since Unix file paths are case sensitive.

Worse still, if you create a replacement variable to turn every instance of the word home into a hyperlink pointing to your home page: <a href="home.html">home</a>.

You might have the situation where the word 'home' is used in locations where creating a hyperlink would cause invalid HTML, such as the following:

<img src="home.gif" alt="" />

...which would end up being delivered to the browser as the following:

<img src="<a href="home.html">home</a>.gif" alt="" />

...which is invalid HTML and will not function correctly.
Copyright © 2024 MH Sub I, LLC dba vBulletin. All rights reserved. vBulletin® is a registered trademark of MH Sub I, LLC dba vBulletin.