Created
September 9, 2013 07:33
-
-
Save vdchristelle/6492499 to your computer and use it in GitHub Desktop.
nieuwsitems uitvullen als er geen foto geupload is
met jQuery of in preprocess_html()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function YOURTHEME_preprocess_html(&$variables) { | |
// add no photo class | |
if (arg(0) == 'node' && is_numeric(arg(1))) { | |
$node = node_load(arg(1)); | |
switch ($node->type) { | |
case 'page': | |
if (empty($node->field_image)) { | |
$variables['classes_array'][] = 'no-photo'; | |
} | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment