Undefined variable in snippet

this should work:

in your snippet:

<?php $GLOBALS['color'] = "now is red"; ?>

in your template:

<?php echo $GLOBALS['color'] ?>
2 Likes