Modernizr.js does the work of the HTML5 shiv for IE, so we only need it if the user doesn't use Modernizr.

Comments

alanburke’s picture

Title: Don't include Modernizr and HTML5 shiv » Don't include Modernizr and HTML5 shiv at the same time

Clarified title

ericduran’s picture

Status: Needs review » Needs work

We should use phptemplate if statements style.

So instead of

<?php // Add HTML5 shiv if Modernizr is not included 
 if (!theme_get_setting('html5_base_modernizr')) { ?>
 <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<?php } ?>

it should be

<?php if (!theme_get_setting('html5_base_modernizr')): ?>
  <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<?php endif; ?>
alanburke’s picture

Status: Needs work » Needs review
StatusFileSize
new734 bytes

Hmm, Coding standards say otherwise?
http://drupal.org/coding-standards#controlstruct
Patch with other style attached anyway :-)

tim.plunkett’s picture

ericduran is right, phptemplate does generally use the alternate syntax.

alanburke raises a good point about the documentation. The coding standards are for straight PHP files, and I don't know if the phptemplate differences are documented.

ericduran’s picture

Yeah, the coding standard are for the modules/php files.

Phptemplate files usually use the alternate syntax. I swear I've seen this documented before but I did a quick search and couldn't find anything. But yes the alternate syntax is the correct way for template files. This is excluding the template.php file as that's an actual php file.

mason@thecodingdesigner.com’s picture

Status: Needs review » Closed (fixed)

As much as I prefer the standar php if syntax, all the themes I've worked on or inherited use the alternate syntax.

I've committed the change.

alanburke’s picture

Status: Closed (fixed) » Fixed
alanburke’s picture

Commit credits.
Any chance of including names on commit credits?
I suspect certifiedtorock examines these for usernames when calculating it's ratings.

mason@thecodingdesigner.com’s picture

I certainly don't mind doing that. Do you know if I have to do anything special? Or just credit folks in the commit message?

tim.plunkett’s picture

There are instructions here.

mason@thecodingdesigner.com’s picture

thanks, Tim

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.