![]() |
|
|
Article Options |
|
[How-to] Make Your vB Template XHTML Validate Correctly
by
Rating:
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:
Replace with text:
This will add the xmlns attribute to the <html> tag and now your pages should validate as XHTML.
Turns into
Happy Validating!
No members have liked this post.
|
||||||||||||||||
|
Views: 2422
|
||||||||||||||||
| Comments |
|
#3
|
||||
|
||||
|
Awesome, cheers!
![]() No members have liked this post.
|
|
#4
|
||||
|
||||
|
realy awesome
![]()
__________________
First iranian anime ,manga & animation professional forum.http://forums.animparadise.com No members have liked this post.
|
|
#5
|
||||
|
||||
|
Originally Posted by Analogpoint
With the new vB release, it should be corrected. If you check now that link, it say is Valid XHTML 1.0 Transitional.
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke! vB-Italy.org - Italian vBulletin Support Forum No members have liked this post.
|
|
#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".
No members have liked this post.
|
|
#7
|
||||
|
||||
|
LOL
![]()
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke! vB-Italy.org - Italian vBulletin Support Forum No members have liked this post.
|
|
#8
|
||||
|
||||
|
No members have liked this post.
|
|
#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:
Replace that with
and you will have xmlns="http://www.w3.org/1999/xhtml'; inserted in the right place in your <html>-tag. 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. No members have liked this post.
Last edited by Peter85 : 19 Feb 2008 at 10:55. |
||||||||
![]() |
«
Previous Article
|
Next Article
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Article Options | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 11:34.





