|
Home > Archive > Microsoft Content Management Server > February 2006 > The age old question of XHTML 1.0 Transitional Compliance
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
The age old question of XHTML 1.0 Transitional Compliance
|
|
| Tony Collings 2006-02-15, 7:50 am |
| Being a government body our website has to conform to all sorts of
regulations, one of them being w3c validation.
Our current <!DOCTYPE> model for all code is XHTML 1.0 Transitional,
but Visual Studio does some nasty things with code.
By playing around with tools / options we've managed to avoid alot of
incorrect code, by getting VS.NET to stop mucking around with your when
you switch between design and html view, but there are still a few
problems that we cannot get around. The biggest one being the CMS
RobotMetaTag control :
<cms:robotmetatag id=RobotMetaTag1 runat="server"></cms:robotmetatag>
Which renders out both a robots metatag and a base ref to the posting,
both of which can't be self-closed.
<meta name="ROBOTS" content="FOLLOW,INDEX">
<base
href="http://www.northamptonshire.gov.uk/ncc/Templates/homepage.aspx?NRMODE=Published&NRORIGINALURL=%2f&NRNODEGUID=%7b40DDDDCD-8777-4EB8-83AC-6475493BA63E%7d&NRCACHEHINT=NoModifyGuest">
Is there anyway to make the <cms:robotmetatag> XHTML1.0 transitional ?
So that the HTML it outputs is compliant ?
Anyone else made a CMS2002 site successfully XHTML1.0 compliant ?
Cheers,
| |
|
| Hi Tony,
> Being a government body our website has to conform to all sorts of
> regulations, one of them being w3c validation.
We're currently going through exactly the same process as yourselves.
>
> Our current <!DOCTYPE> model for all code is XHTML 1.0 Transitional,
> but Visual Studio does some nasty things with code.
>
> By playing around with tools / options we've managed to avoid alot of
> incorrect code, by getting VS.NET to stop mucking around with your when
> you switch between design and html view, but there are still a few
> problems that we cannot get around.
Could you give me any pointers to the settings you had to change to stop
VS.NET screwing up the HTML?
> The biggest one being the CMS
> RobotMetaTag control :
>
> <cms:robotmetatag id=RobotMetaTag1 runat="server"></cms:robotmetatag>
>
> Which renders out both a robots metatag and a base ref to the posting,
> both of which can't be self-closed.
>
> <meta name="ROBOTS" content="FOLLOW,INDEX">
> <base
> href="http://www.northamptonshire.gov.uk/ncc/Templates/homepage.aspx?NRM
> ODE=Published&NRORIGINALURL=%2f&NRNODEGUID=%7b40DDDDCD-8777-4EB8-83AC-64
> 75493BA63E%7d&NRCACHEHINT=NoModifyGuest">
>
> Is there anyway to make the <cms:robotmetatag> XHTML1.0 transitional ?
The easiest way is to just re-write an XHTML-compliant version of the
control yourself.
All you need to do is grab the current posting object and look at the
IsRobotFollowable and IsRobotIndexable properties and write out the
appropriate XHTML.
Let me know if you need some code and I'll dig out the appropriate section
from our solution.
Regards,
John
| |
| news.microsoft.com 2006-02-17, 10:50 pm |
| We've beem relativly successfull in creating MCMS sites that validate to
XHTML 1.0 strict by running some code on render that converts all the
non-compliant markup.
You may find this article usefull.
http://www.codeproject.com/aspnet/ASPNET2XHTML.asp
As for visual studio we've outlawed using the design view in vs2003, as long
as you don't enter the design view your code won't get messed up. (You can
set your preferences to always open in html view).
Estyn
"John" <john.b1@nospam.blueyonder.co.uk> wrote in message
news:memo.20060215170930.1824A@jbnw27167.blueyonder.co.uk...
> Hi Tony,
>
>
> We're currently going through exactly the same process as yourselves.
>
>
> Could you give me any pointers to the settings you had to change to stop
> VS.NET screwing up the HTML?
>
>
> The easiest way is to just re-write an XHTML-compliant version of the
> control yourself.
>
> All you need to do is grab the current posting object and look at the
> IsRobotFollowable and IsRobotIndexable properties and write out the
> appropriate XHTML.
>
> Let me know if you need some code and I'll dig out the appropriate section
> from our solution.
>
> Regards,
>
> John
>
| |
| Spencer Harbar [MVP] 2006-02-21, 5:52 pm |
| Hi Tony ,
With respect to the <cms:robotmetatag /> control to get around it's non
standard output you need to implement your own version.
An example of this can be found at
http://www.gotdotnet.com/Community/...BB-D179927179D5
simply adding the correct closing markup.
hth
Spence
www.mcmsfaq.com
"Tony Collings" <tony.collings@gmail.com> wrote in message
news:1140009120.198515.39160@o13g2000cwo.googlegroups.com...
> Being a government body our website has to conform to all sorts of
> regulations, one of them being w3c validation.
>
> Our current <!DOCTYPE> model for all code is XHTML 1.0 Transitional,
> but Visual Studio does some nasty things with code.
>
> By playing around with tools / options we've managed to avoid alot of
> incorrect code, by getting VS.NET to stop mucking around with your when
> you switch between design and html view, but there are still a few
> problems that we cannot get around. The biggest one being the CMS
> RobotMetaTag control :
>
> <cms:robotmetatag id=RobotMetaTag1 runat="server"></cms:robotmetatag>
>
> Which renders out both a robots metatag and a base ref to the posting,
> both of which can't be self-closed.
>
> <meta name="ROBOTS" content="FOLLOW,INDEX">
> <base
> href="http://www.northamptonshire.gov.uk/ncc/Templates/homepage.aspx?NRMODE=Published&NRORIGINALURL=%2f&NRNODEGUID=%7b40DDDDCD-8777-4EB8-83AC-6475493BA63E%7d&NRCACHEHINT=NoModifyGuest">
>
> Is there anyway to make the <cms:robotmetatag> XHTML1.0 transitional ?
>
> So that the HTML it outputs is compliant ?
>
> Anyone else made a CMS2002 site successfully XHTML1.0 compliant ?
>
> Cheers,
>
| |
| Glen Wells 2006-02-26, 10:46 am |
| Take one HTTP module, sprinkle it with regular expressions, add a dash of
output caching and you'll have yourself a delicious XHTML1.0 compliant
website.
You can make the module check that you are in PresentationPublished mode so
that it doesn't bother to do its trickery for authors, which saves the
server resources used by those RegEx calls, and I really do recommend output
caching so that the RegEx calls are not happening on every page impression.
--
Glen Wells
www.cubik.co.uk
"Tony Collings" <tony.collings@gmail.com> wrote in message
news:1140009120.198515.39160@o13g2000cwo.googlegroups.com...
> Anyone else made a CMS2002 site successfully XHTML1.0 compliant ?
|
|
|
|
|