Skip to content

Instantly share code, notes, and snippets.

@marcoscoelho
Created May 31, 2011 18:04
Show Gist options
  • Save marcoscoelho/1000987 to your computer and use it in GitHub Desktop.
Save marcoscoelho/1000987 to your computer and use it in GitHub Desktop.
Using plugin theme to generate an image optional
Image traditional
{pyro:theme:image file="icons/{pyro:module_details:slug}.png" base="path"}
<?php
echo 'html_img_open' . 'path' . 'file' . 'html_img_close'; // image tag
?>
Image optional using the attribute: 'base="path?"'
{pyro:theme:image file="icons/{pyro:module_details:slug}.png" base="path?"}
<?php
if (is_file('file')) :
echo 'html_img_open' . 'path' . 'file' . 'html_img_close'; // image tag
else:
echo ''; // empty string
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment