View Full Version : (vBorg Tutor) [How-to] Make Your vB Template XHTML Validate Correctly


Disjunto
14th September 2007, 08:33 AM
Here's a small summery of a tutorial / how do I, as posted on vBulletin.org. Go check it out!

Title: [How-to] Make Your vB Template XHTML Validate Correctly
Author:
Published: Thu, 13 Sep 2007 16:31:24 GMT

Have you tried validating your vBulletin-powered site with the W3C validator (http://validator.w3.org)? A standard vB installation will fail the validation with one error-- it's missing the xmlns attribute for html tag at the very beginning. You can check this by validating the vB forums (http://validator.w3.org/check?uri=www.vbulletin.com%2Fforum).

The tag should look like

So until vB's default templates are changed to include the xmlns info, I needed a workaround, and I didn't want to manually edti dozens of templates.

In comes a brilliant feature that is implemented in the ACP. Expand the Styles & Templates section and click on Replacement Variable Manager.

Add a new Replacement Variable for each of your parent styles.

Search for text:

Codedisplayerror: (Update license status (http://members.vbulletin.com/membersupport_priority.php)) You cannot view code until you prove your license status
Replace with text:

Codedisplayerror: (Update license status (http://members.vbulletin.com/membersupport_priority.php)) You cannot view code until you prove your license status
This will add the xmlns attribute to the tag and now your pages should validate as XHTML.


Codedisplayerror: (Update license status (http://members.vbulletin.com/membersupport_priority.php)) You cannot view code until you prove your license status
Turns into


Codedisplayerror: (Update license status (http://members.vbulletin.com/membersupport_priority.php)) You cannot view code until you prove your license status
Happy Validating! :)



Read More! (http://www.vbulletin.org/forum/showthread.php?t=157754&goto=newpost) :D