[How-to] Make Your vB Template XHTML Validate Correctly
Have you tried validating your vBulletin-powered site with the W3C validator? 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.
The <html> tag should look like <html xmlns="http://www.w3.org/1999/xhtml"> 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: Code:
<html Code:
<html xmlns="http://www.w3.org/1999/xhtml" Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
thanks dood!
|
Awesome, cheers! ;)
|
realy awesome :)
|
Quote:
|
I wanted to say the same thing about 2 hours ago Triky... but then i looked at the thread date and i said to myself: "Naaaaaaaaaaaah".
|
|
|
The fix suggested by Analogpoint has the downside of making all templates showing up as modified.
Another fix for making vBulletin 3.6.x validate is to hack the includes/functions.php file. Line 4628 (or somewhere around there) should read: Code:
$stylevar['textdirection'] = 'ltr'; Code:
$stylevar['textdirection'] = 'ltr" xmlns="http://www.w3.org/1999/xhtml'; My suggestion for a fix is much uglier but it has the benefit that it can be undone very easily and doesnt make all your templates show up as modified. Edit: After doing some testing I realised that that variable is also used in some of the templates. So there will still be template edits. Hopefully not as many though. |
All times are GMT. The time now is 11:15 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|