Jump to content

HTML Validation


skshost

Recommended Posts

Any successfully validated their WHMcs install?

Of course there's many pages withing WHMcs that do validate, but I'm having issues with links containing a session ID. Also get errors with links to knowledge base articles.

 

I did end up modifying my .htaccess to redirect to "myhost.com/order.php?step=2&pid=1" with alternate links("myhost.com/basicplan.order" kinda neat) to get my pages outside of WHMcs to validate, but this won't work with issues within WHMcs.

 

Any ideas?

 

For those who aren't familiar: http://validator.w3.org/

Link to comment
Share on other sites

It can't be fully W3 validated because some of code printed to the template is generated by the system. In order to make it compliant, you will have to pass any template vars that the system generates to a modifier or callback function that will perform markup correction.

 

Is there any reason that you need it 100% W3 compliant? and what is the doctype you are trying to achieve?

Link to comment
Share on other sites

Well, it's something that you'd have to script, so if you're not a programmer, then it's a steep learning curve.

 

The good news is, for what you want to do, make it 4.0 ? transitional, the home page should be easy enough to make compliant. That will just necessitate changes of your template files, since there is little of no script output there.

 

When you browse to (make sure the host and path is correct)

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.skshost.com%2Fwhmcs%2F

 

The W3 validator will tell you exactly what you need to fix. You will need to fix the header, footer and body of the home page. If you customized it, you may have to fix a few other pages too.

 

I believe the reason why there is no validated markup is two-fold:

 

1. Matt can't control if you need XML, HTML be it STRICT LOOSE or TRANSITIONAL

2. Basic markup will work and is backwards compatible (for the most part unless a user's browser is set to strict or a specific markup version)

3. WHMCS has been in development a while and it's just not practical to go back and recode everything as of yet (even though it'd be nice)

 

-----

 

Now back to the stuff I mentioned...

 

With a smarty modifier, you could automatically correct all markup using Tidy. It is a bit of work, but can be done with a little ingenuity. But for practical purposes, unless you are looking to do something very specific (like ISO certification) then it's not what you need ... anyway ...

 

A smarty modifier is used like: {$variable|modifier_name}

 

This will pass the contents of $variable to a smarty script that you would need to write, in order to correct the markup. For more on smarty see http://smarty.php.net. You can do all sorts of neat stuff with smarty modifiers and functions :D.

 

With a php callback function, the same could be achieved. It can essentially save the output to a variable, allowing you to perform whatever actions you need.

 

Anyway, there would be a way to do this, using "tidy", and building the modifier to correct all markup, before the page gets saved to the cache. Best is to use a Smarty modifier, not a callback.

Link to comment
Share on other sites

Thanks for the info. I have used modifiers quite a bit recently. I'm not quite sure if the main problem I'm facing deals with anything more than links like this: "http://myhost.com/whmcs/knowledgebase.php?action=displayarticle&catid=1&id=1". This is on the homepage which I've modified to include "most popular knowledge base articles".

 

Tidy could solve this?

Link to comment
Share on other sites

That'd be easy if I was the one deciding what the most popular knowledge base articles are. It's generated from the database(by views), so that's why I wasn't confident that I could validate.

 

EDIT: I could just use a smarty modifier.. I'll try that..

Link to comment
Share on other sites

No sleep for a bit now, so it took looking at the template source to realize 1 problem. Only 1 problem and I'll have no difficulty validating any page of my WHMCS install:

 

cannot generate system identifier for general entity "PHPSESSID".
...layarticle&catid=1&id=4&&PHPSESSID=6c6a0...

reference to entity "PHPSESSID" for which no system identifier could be generated.
...e&catid=1&id=4&&PHPSESSID=6c6a0...

 

I have no clue. Sleep may avail a solution, or coffee.. :shock:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated