Validation

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
1/21/2009 7:42:30 AM
Gravatar
Total Posts 118

Validation

As you add features etc to pages, it is logical to assume that for various reasons some pages may not pass validation of one form or another. It would be useful to be able to flag individual pages as not passing validation and the flag used to stop the various validation links being shown.

 

Neil

1/21/2009 8:12:43 AM
Gravatar
Total Posts 18439

Re: Validation

Hi Neil,

That's not possible. The page has no way of knowing whether it is rendering valid xhtml. The validator link is as much a tool for finding invalid pages on your site as it is a badge for passing validation.

All the features included with mojoPortal were designed with the intention of producing valid markup, that is all the markup generated by the software is designed to render valid markup, however it does not prevent a user from entering invalid content into the database.

Taking the most basic example, the Html content feature is designed to render valid xhtml and the markup that it generates to wrap the user entered content is in fact valid, but you can easily make the user entered content invalid by pasting in stuff from Word (though there is a toolbar item to help you avoid bad markup from pasting from Word), or scraping some html fragment from another page (you might miss a closing tag or the scraped content may be invalid to begin with). Its also possible to add invalid content directly via html source view in the editor. The validator link can help you realize this has happened so you can try to clean up the content. The WYSWIG does a good job of creating valid markup other than things you paste in. It has the paste as text toolbar button and the paste from Word button to help with pasting so it doesn't add bad markup.

If you find a feature in mojoPortal that you think is producing invalid markup (not counting the user entered content) please let us know so we can fix it if its true.

Note that the link doesn't work on non-public pages because the w3c validator can't get the content from those because its not in a role with permission. To check validation on those pages you can view the rendered source of the page and paste it into the validator using its direct input method.

If most of your pages are validating and maybe you have a few pages with a third party feature that doesn't produce valid markup, I would not worry too much about it. The vast majority of people who visit your site never click the validator link and hardly anyone does it on all the pages. If you were really concerned about it you can make an alternate skin for a page you know is not valid and leave the link out.

Best,

Joe

1/21/2009 8:31:55 AM
Gravatar
Total Posts 118

Re: Validation

Joe

You missunderstood my request. I was suggesting a field that you could manually tick or otherwise to flag that it should not have the validation link.

I take your point about trying to achieve validation - but know that some functionality for what ever reason, particularly when creating a site for a third party will not pass validation. This may be reasonable depending on the situation and my suggestion would allow this - but still give the validation link on pages that you know will validate.

 

Regards

 

Neil

1/21/2009 8:38:26 AM
Gravatar
Total Posts 18439

Re: Validation

Hi Neil,

Sorry but I don't think this merits a feature or adding a field to the database.

If its important to you to achieve this, a workaround is possible using an alternate skin on pages that you would tick as invalid. Just copy the main skin and name it -novalidation and remove the validator link from the layout.master. Then assign this skin on pages where you don't want the validator link.

Best,

Joe

1/21/2009 8:47:59 AM
Gravatar
Total Posts 118

Re: Validation

ok - your call

1/21/2009 9:01:14 AM
Gravatar
Total Posts 18439

Re: Validation

Just fyi, the factors that go into my decision are:

it requires development effort, time is money, my time is limited and I must use it wisely for things that add a lot of value and not let myself get pulled into using my time on less important things. I'm living on savings not making a living on mojoPortal yet.

I don't like to add more settings unless I think they add a lot of value, more settings is less user friendly and more confusing.

I want to encourage actually producing valid content, not the illusion of it. Third party developers should make their features render valid markup.

A reasonable workaround exists with alternate skins or you can simply assert its valid without a link.

I don't think its the end of the world if a user click a link and it says it failed validation if most pages do validate.

Less than 1% of your visitors will ever click that link at least that is what my data shows.

Best,

Joe

2/3/2009 12:24:22 PM
Gravatar
Total Posts 18439

Re: Validation

Hi Neil,

Based on further discussions we had offline, your point is well taken about if you have a page that can't validate and your customer wants to beat you up about it and only have that link on pages that do validate. The alternate skin solution will work but I agree its cumbersome.

I think part of my resistance to adding a field to the pages table for "Show Xhtml Validation" is because the Xhtml validation link is not even mandatory in the skin, so if it were removed this setting would no longer make sense and would just be an extra setting.

So, I got an idea to solve it more easily without adding this field. Instead I've added a property on the XhtmlValidationLink control named ExcludePagesCsv.

So if you have a page in your site named MyInvalidPage.aspx, you could set ExcludePagesCsv="MyInvalidPage.aspx". If you have more than one you can separate them by commas. If the url contains the page name, then it will not show the validation link.

This solution of course does not scale well to a site with a whole bunch of bad pages, but it gives an easy solution if you have a few problem pages.

I implemented this today so it will be in the next release.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.