Custom Attributes (PHP) Help
Permalink
If I add a custom attribute like main_image, using the following code on the page.
<img src="<?php echo ($c->getAttribute('main_image')->getVersion()->getRelativePath());?>" class="img-responsive center-block">
how do I write the php code to use a fallback image if they haven't added one, as if I create the page and I don't add an image I get a error of call to none object.
Cheers
Mal
<img src="<?php echo ($c->getAttribute('main_image')->getVersion()->getRelativePath());?>" class="img-responsive center-block">
how do I write the php code to use a fallback image if they haven't added one, as if I create the page and I don't add an image I get a error of call to none object.
Cheers
Mal