Created
May 7, 2016 18:11
-
-
Save skwashd/601ec44d44a1dfeb315f44e6c7171397 to your computer and use it in GitHub Desktop.
preprocessor example
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
<div> | |
<?php print $name_of_var; ?> | |
</div> |
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
<?php | |
/** | |
* Implements template_preprocess_node(). | |
*/ | |
function mytheme_preprocess_node(&$variables) { | |
if ('blog' == $variables['type']) { | |
mytheme_preprocess_node_blog($variables); | |
} | |
} | |
function mytheme_preprocess_node_blog($variables) { | |
$variables['name_of_var'] = filter_xss($block_var); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment