I want to check if the client has populated the 'Artwork Slideshow' region, and if not use the images they have populated the 'Artwork Images' with instead.
Is this possible. The code is taken from the /perch/templates/pages/artwork.php template.
That's almost there, it's successfully replaced the empty region. However it no longer shows the artwork images region in the template afterwards. I need both regions to be displayed with one copying substitute content from the other if empty.
I can't figure that out, maybe the code might help explain what I'm trying to achieve:
I want to check if the client has populated the 'Artwork Slideshow' region, and if not use the images they have populated the 'Artwork Images' with instead.
Is this possible. The code is taken from the /perch/templates/pages/artwork.php template.
I'm not going to redo your entire code block, but I have added the checks you asked for.
It's not the best approach, but its a working example based on your supplied example.
Thanks Robert,
That's almost there, it's successfully replaced the empty region. However it no longer shows the artwork images region in the template afterwards. I need both regions to be displayed with one copying substitute content from the other if empty.
Is this possible?
Hello Robert,
I've figured it out using your method of storing the region as a standard php variable. Many thanks.
For anyone with a similar issue, I declared the regions at the top of the pages template and stored them as PHP variables:
Then used an if statement to check for content as required with a fallback:
Then echoed the artwork region wherever required:
Thanks again Robert.
Regards Tony