SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict revlimiter's Avatar
    Join Date
    Sep 2005
    Location
    British Columbia, Canada
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PHP: excluding file from W3C validation

    Hi,
    I am using the colorbox framework (http://colorpowered.com/colorbox/) and it works great on my site.

    However, the CSS does not validate and this is a known issue for this framework:
    http://jigsaw.w3.org/css-validator/v...1%2Findex.html

    I wish to exclude colorbox.css from W3C CSS validation. I remember reading about some PHP that will do this, just by enclosing the .css source in a PHP statement, but I can't remember where to find this...

    Any help is greatly appreciated.
    Thanks!
    "To make an apple pie from scratch,
    you must first create the universe.
    -Carl Sagan

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Is there any reason for this? Excluding it doesn't make it any more valid.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Addict revlimiter's Avatar
    Join Date
    Sep 2005
    Location
    British Columbia, Canada
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For 2 reasons:
    1) Because the rest of my site validates perfectly
    2) I have validation links in the footer

    There is no alternative other than switching jQuery frameworks and I can't do that because colorbox has been heavily implemented. So it looks like excluding that CSS file is my only other option.

    Thanks
    "To make an apple pie from scratch,
    you must first create the universe.
    -Carl Sagan

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    You could also eliminate the validation links...

    Anyway, validation is done on the resulting HTML/CSS code, not on the PHP script. So if there is a way to exclude some parts of a page from validation (seems strange to me, but who knows), then it would have to be some kind of HTML or CSS construction.
    Find out what it is, and then it shouldn't be too difficult to implement in PHP.

  5. #5
    SitePoint Guru Chroniclemaster1's Avatar
    Join Date
    Jun 2007
    Location
    San Diego, CA
    Posts
    784
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think the issue is even more basic than that. You can use the (X)HTML validation links, and it sounds like those are fine. You can't use the CSS validation links because your site doesn't validate. You're stuck with a framework with bad CSS, and visitors are going to have to deal with that. As long as you don't have the valid CSS link you should be fine. I don't think you have any issues at all. And realistically if you're trying to make your site "look" valid to the validation software even though its not, you have a much more basic problem, honesty and usability. Your visitors are going to be affected by the issues of bad CSS, it would be inappropriate to tell them your site's CSS is valid. It doesn't matter if it's one particular stylesheet, that's still an integral component of your website's CSS. In my experience you don't want to establish the expectation if you can't deliver the goods. That's not a bad thing. If you, your visitors, and / or your clients want to take advantage of the benefits of the framework, then bad CSS is one of the tradeoffs that goes with that. It doesn't mean anyone is doing a bad job, it's the evaluation process you go through with any 3rd party software / component / etc. It's just important to be honest about what things do and wahat they don't. It's all about managing expectations. And that's the big reason you wouldn't want a valid CSS logo on the site.

    That being said, IMO, I hate the validation logos. I find the entire idea tacky and never recommend using them.
    Whatever you can do or dream you can, begin it.
    Boldness has genius, power and magic in it. Begin it now.

    Chroniclemaster1, Founder of Earth Chronicle
    A Growing History of our Planet, by our Planet, for our Planet.

  6. #6
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't understand the point of the validation buttons in general. I don't think they are useful, or that users care about them. And if you have code that isn't valid they become extra pointless.
    I think the problem is a little backwards...like finding it too dark inside when wearing sunglasses. You could either remove the roof or take the sunglasses off.

  7. #7
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    69 Post(s)
    Tagged
    0 Thread(s)
    I have to agree with cranial here.
    Excluding a page to pass validation is like excluding your income to file taxes. It's perfectly valid on what you did submit, but that isn't the point of the exercise.

    Fix the CSS, or remove the links (i'd go with option 2)

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,789
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Those links that indicate that a page passes validation are an indication that the page owner is still a novice when it comes to validation. Get rid of them completely and you will appear more professional.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  9. #9
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by cranial-bore View Post
    I don't understand the point of the validation buttons in general. I don't think they are useful, or that users care about them. And if you have code that isn't valid they become extra pointless.
    Agreed - even if you do have valid code, they are pointless and make you look a bit amateurish. Anybody who cares about valid code and is bothered in seeing if you have valid code will know how to check - and to anyone else, they're just an unnecessary distraction. And when the validation button gives the result "This page is not valid" it is worse than "extra pointless", it is positively harmful, and makes you look totally incompetent...
    I think the problem is a little backwards...like finding it too dark inside when wearing sunglasses. You could either remove the roof or take the sunglasses off.
    Brilliant!

  10. #10
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Indirect approach to fixing it: Colorbox appears to be Open Source Software.

    Fix the CSS.

  11. #11
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    I love it when you see 'this site is valid blah blah blah' and then the validator throws hundreds of errors

    If you use CSS that isn't valid, then excluding it from being validated is cheating.
    It's like asking your teacher to ignore the questions you got wrong when he's marking your exams.

    Solutions?
    - Fix the CSS
    - Remove the Validation buttons

    Preferably both


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •