Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Modern Theme (X)HTML W3C validation— HTML5 validator
 
unique2
Jr. Member
 
Total Posts:  6
Joined:  2010-03-19
 

Hi Everyone,

I am new to Magento but I wanted to start out on the right note by making sure all of theming I do for my test site is HTML5 Validated. I just took the default Modern theme that comes with the latest version of magento community (version 1.4.0.1) and applied it to my site.  Looks good, I wanted to see if it would validate by default.

The answer is no.  I used this validator http://html5.validator.nu/ and just pasted in the home page code and I got 10 warnings and 2 errors.  Most of which look exactly like this:

#
WarningThe border attribute is obsoleteConsider specifying img { border0} in CSS instead.
From line 192column 136to line 192column 263
dal
.html"><img src="http://www.localmagento.com/magento/skin/frontend/default/default/images/ph_callout_left_top.gif" border="0" alt="" /></a></
or

#
ErrorThe cellspacing attribute on the table element is obsolete. Use CSS instead.
From line 231column 1to line 231column 34
ucts
</h3>↩<table border="0" cellspacing="0">↩<tbod

I decided to attack the top warning first.  It looks like the error is the border="0" part above.  If I am correct, this html is actually part of the header, so my first instinct was to look in the header.phtml file.  In the app->design->default->modern->template->html->header.phtml:

<div class="header">
        
<?php if ($this->getIsHomePage()):?>
        
<h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
        
<?php else:?>
        
<a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>
        
<?php endif?>
        
<class="top-promo" title="<?php echo $this->__('Free Shipping on orders over 50$'); ?>"><?php echo $this->__('Free Shipping on orders over 50$'); ?></p>
        
<?php echo $this->getChildHtml('topMenu'?>
    
</div>

And now I am assuming one of these php functions is adding this silly border="0" but again, just guessing.  So I went to the header.php where all these functions are declared.  In the app->code->core->Mage->Page->Block->Html->Header.php I noticed that none of these functions have a hard coded border="0" ...

I’m stumped.  Does anyone know where in Magento this border="0" is added so I can proceed with my error and warning validation of this template?  Also, if you know how to fix the other error as it seems very similar that would be very helpful too! grin

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

I believe what the top warning is referring to is in the CMS home page as it sounds that you have installed the default store data.

So check here: Admin > CMS > Pages - look for the “home” identifier and click on it to edit that page. Then go to the content section and you should find the offending code.

 
Magento Community Magento Community
Magento Community
Magento Community
 
unique2
Jr. Member
 
Total Posts:  6
Joined:  2010-03-19
 

Hi seudo?

Thanks for the reply.  You are correct this was just in the sample data.  I don’t know why I didn’t originally think to go there.  I guess I just wanted to make things more difficult than they actually were.

This fixed the problem completely.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top