Results 1 to 17 of 17

Thread: 2.9.4 W3C validation error

  1. #1
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default 2.9.4 W3C validation error

    Good afternoon.

    I'm working on a new install of Contao 2.9.4 and after getting the template installed and up and running, I've come across a validation error but I'm not sure which system template is causing this:

    ------
    Line 30, Column 80: end tag for "link" omitted, but OMITTAG NO was specified

    <link rel="stylesheet" href="system/contao.css" type="text/css" media="screen">

    You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
    -------

    It appears that an internal template is leaving off the trailing "/" just after the media="screen". I haven't modified the system templates, so it appears to be a minor error in one of the templates.

    Does anyone know which file in Contao loads this call to the system/contao.css file and where I might be able to find the line of code that needs to be fixed? This is the first time I've seen this error in Contao, so I suspect that it is being introduced with 2.9.4.

    Ernest McDermon
    Snellville, GA

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: 2.9.4 W3C validation error

    The online demo, nor any of my websites I used 2.9.4 for have this problem with either of the dtd's. Are you sure that code is actually in your output code. Also, which defaults are you not using (custom templates and so on)

  3. #3
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default Re: 2.9.4 W3C validation error

    In the page layout I am using a custom template file, fe_page_home.tpl, that exhibits the error, but when I switch to the default fe_page.tpl the validation error occurs there as well. I have a very similar site with an identical .tpl file using Contao 2.9.3 that validates.

    The link throwing the error in 2.9.4 is the one that appears to call the system/contao.css file, and this appears to be in a template file that calls the head area. I don't which file that is, because that's where I believe the error is.

    I appreciate that the error doesn't seem to be appearing in the demo site, but if that was upgraded, then the files may not be the same as the clean install I did with 2.9.4. In any event, this error is occurring, this is the first full site I've been working on with a clean install of 2.9.4, and this is the first time I've seen this error.

    Does anyone else have a suggestion as to where I could find the line of code in the Contao system that is calling the link to the system/contao.css file that appears dynamically at load? I want to inspect that element to see if the trailing "/" is missing in the code as I suspect that it is.

    Any other suggestions would be appreciated!

    Ernest McDermon

  4. #4
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: 2.9.4 W3C validation error

    Can you check your version of \system\modules\frontend\PageRegular.php (around line 288):
    Code:
    // Include basic style sheets
    $this->Template->framework .= '<link rel="stylesheet" href="system/contao.css" type="text/css" media="screen" />' . "\n";
    As you can see the slash is hard coded.

  5. #5
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default Re: 2.9.4 W3C validation error

    Thanks for the comeback.

    // Include basic style sheets
    $this->Template->framework .= '<link rel="stylesheet" href="system/contao.css" type="text/css" media="screen" />' . "\n";

    This line is in fact on the PageRegular.php file in the 2.9.4 code structure, but it continues to fail validation. I tried an experiment, and changed the sequence above to show the text/css call in FRONT of the href portion as in:

    $this->Template->framework .= '<link rel="stylesheet" type="text/css" href="system/contao.css"media="screen" />' . "\n";

    But when I refresh the page, and revalidate, the error still apprears and when viewing page source, the code shows:

    $this->Template->framework .= '<link rel="stylesheet" href="system/contao.css" type="text/css" media="screen" >' . "\n";

    with the text/css BEHIND the href call and the mysterious / having "vanished" and the code error still exists.

    This line of code seems to be loaded from another template file I'm assuming since if I edit that line in PageRegular.php, the edit should appear when validating. Do you have any other suggestions as to where this code might be loaded from?

    This error is not a major one, but its not going away, and may be only apparent on a Linux/Apache system.

    I've always believed that anytime code doesn't work as expected, that it is a generally a "bug" that is not readily apparent, but is generally fairly simple to fix once located. I think this is the case here that this code is being loaded from another file in the system that we don't realize.

    Any suggestions would be appreciated, I like to have all W3C errors cleared.

    Ernest McDermon
    Snellville, GA

  6. #6
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: 2.9.4 W3C validation error

    Do you have a link to the page at all Ernest ?

  7. #7
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: 2.9.4 W3C validation error

    Indeed, do you have a page link. I find it hard to believe the same code has a different outcome. Some other output processing might apply as well, so I'd like to see this myself.

    Furthermore; if you still think this is a bug you should report it and describe your setup so it can be reproduced. If it is indeed a bug on Contao's part it can be fixed. http://dev.contao.org/

  8. #8
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default Re: 2.9.4 W3C validation error

    Here's the page:

    http://74.53.25.34/~reeveaso/home-page.html

    I'm converting a purchased template to a Contao Theme so this is "under construction" but it is "live". We'll change the new site with logo and text this weekend.

    Since modifying the PageRegular.php file doesn't seem to take effect on the call to the contao.css file and the error continues to appear, then there must be another file in the system that is actually driving that link. Not sure where it "lives", but it will be located eventually.

    I'll go ahead and report this on the Developer's forum. Meanwhile I'm clearing out the css validation errors on the template conversion.

    Thanks for the input, if you guys come across a solution for this, let me know.

    Ernest McDermon
    Snellville, GA

  9. #9
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: 2.9.4 W3C validation error

    Can you post your page template (fe_page_home.tpl)? I know the error happens with the default as well, I just want to see.

    Also please list which extensions you are using.

  10. #10
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default Re: 2.9.4 W3C validation error

    Okay, I've attached the default template we're using.

    [attachment=0:dc9zf416]fe_home_page.zip[/attachment:dc9zf416]

    Thanks again, below are the extensions that are installed in 2.9.4 (clean install not an upgrade). No errors or warnings on the extensions during install, no blank screens, and all extensions are "up to date" or "expected to be compatible with Contao 2.9.4".

    Ernest McDermon

    ajax
    avatar
    backend_themeicons
    backend_user_online
    BackupDB
    banner
    botdetection
    cron
    csseditor
    DC_DynamicTable
    dfGallery
    dlh_googlemaps
    dlstats
    efg
    Favicon
    formauto
    gallery
    geshi
    googlesitemap
    helpdesk
    html5boilerplate
    Imageslider
    inserttags
    jquery
    keywords
    lastlogin
    linklist
    literature
    memberlist
    mootoolsnav
    MultiTextWizard
    quickpoll
    related_news
    styleVis
    tags
    tags_news
    ticker
    xls_export
    yw_w3c_validator
    yw_youtube

  11. #11
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: 2.9.4 W3C validation error

    Well they (theres two!) are being echoed out of $this->head for sure.
    The other one is I don't think its Contao core, as I have a cleam 2.9.4 install, and it doesn't do it.

  12. #12
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: 2.9.4 W3C validation error

    Its the html5boilerplate extension.
    lines 253 - 265 of HtmlPage.php
    Code:
    		// Add layout specific CSS
    		if (!empty($strFramework)) {
    			$this->Template->framework .= '<style type="text/css" media="screen">' . "\n";
    			$this->Template->framework .= '<![CDATA[/*><!--*/' . "\n";
    			$this->Template->framework .= $strFramework;
    			$this->Template->framework .= '/*]]>*/-->' . "\n";
    			$this->Template->framework .= '</style>' . "\n";
    		}
    
    
    		// Include basic style sheets
    		$this->Template->framework .= '<link rel="stylesheet" href="system/contao.css" type="text/css" media="screen">' . "\n";
    		$this->Template->framework .= '' . "\n";

  13. #13
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default Re: 2.9.4 W3C validation error SOLVED

    Ramjet: You ROCK!

    The file in my install is:

    system/modules/html5boilerplate/HTML5Page.php

    Lines 263 - 264 when changed by adding the missing "/" as below

    // Include basic style sheets
    $this->Template->framework .= '<link rel="stylesheet" href="system/contao.css" type="text/css" media="screen" />' . "\n";
    $this->Template->framework .= '' . "\n";

    VALIDATE using w3C no errors! Will you report this to the good folks at Boilerplate or do you want me to do that? (You deserve all the credit for identifying the fix!)

    Thank you for for taking some of your time to help me out with this. One of the reasons that I like Contao so much is the wonderful community of experts like you and Ruud who are willing to share their time and expertise to help make this wonderful system even better.

    Ernest McDermon
    Snellville, GA

  14. #14
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: 2.9.4 W3C validation error

    No problem
    I'm certainly no expert, but I like to start my day with a couple of Contao "challenges" as it helps me learn things I wouldn't otherwise :D
    ... I'm even contemplating learning German, as that is where most of the info is (but two years of French at school, a Swiss french girlfriend and two french flatmates later - all I can say is "Please pass the Croissants"!)

    I won't report the boilerplate thing, I don't use it - so up to you.

  15. #15
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: 2.9.4 W3C validation error

    In this case it was actually a simple problem; it is not in the core, so your own templates and 3rd party plugins are the logical choice. Why are you using html5boilerplate? If it is because you want to use jQuery you might also search this forum, there is an excellent step by step guide.

    Ramjet, you should really go for learning German. It is about as difficult as French though (according to a comparison chart). But as long as you don't say "Je suis une Baguette" then you might manage German as well. I've had 3 years of French and I managed. But right now all of that knowledge is gone...

  16. #16
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default Re: 2.9.4 W3C validation error

    Ruud:

    I'm already using jQuery with Contao, and yes I'm familiar with the excellent tutorial. Thanks for the suggestion.

    I'm curious about html5boilerplate and just wanted to start learning more about it. This particular load of this site is not only for a friend's client, I'm taking the time to use it as a test bed to convert a standard JustDreamweaver template to a Contao theme (not as easy as I first thought) and have it work across the Contao platform, validate etc. The first iteration I've uncovered a "bug" in the html5boilerplate extension that no one else has noticed or reported on the forum. All part of the learning curve, and hopefully this thread will add to the Forum's body of knowledge for all.

    I'm also learning that the Contao "jquery" extension that loads the jQuery archive has to be managed in the template as there is a set load order in jQuery to loading the various jQuery libraries to ensure that they work properly together and in the presence of MooTools (and other javaScript routines).

    Thanks for your suggestions and advice, they were much appreciated!

    For the two of you from my years in Germany, (Third Armored Division, Frankfurt, (then) West Germany)...

    Danke schoen (and merci beaucoup)!

    Ernest McDermon
    Front Wave Websites
    Snellville, GA "Where everybody is somebody!"

  17. #17
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: 2.9.4 W3C validation error

    Quote Originally Posted by ernestmcd
    I'm also learning that the Contao "jquery" extension that loads the jQuery archive has to be managed in the template as there is a set load order in jQuery to loading the various jQuery libraries to ensure that they work properly together and in the presence of MooTools (and other javaScript routines).
    I'd like to know more about that. I'm having minor difficulties having the both of them on a single page...

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
  •