The Arcive of vBulletin Modifications Site. |
|
|
[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"> <html dir="ltr" lang="en"> Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
|
|
#2
|
|||
|
|||
|
thanks dood!
|
|
#3
|
||||
|
||||
|
Awesome, cheers!
|
|
#4
|
||||
|
||||
|
realy awesome
|
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
||||
|
||||
|
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".
|
|
#7
|
||||
|
||||
|
LOL
|
|
#8
|
||||
|
||||
|
|
|
#9
|
|||
|
|||
|
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. |
![]() |
|
|