Jump to content

Recommended Posts

Posted

I have a repeater field hero_items that I use for hero images. If no image is uploaded, an image field (settings_hero_image) from the global settings should be displayed. Unfortunately that does not work. The code for the data is correct. If the parts are single (hero_items or settings_hero_image) the images will be displayed. If no image is uploaded under hero_items, the browser code looks blank. Actually, else should now be displayed.

If images are uploaded, the source code is correct.
What is wrong with my if else query?

 

Posted

To debug such things TracyDebugger is extremely helpful! You could have just dumped $page->hero_items to the debug bar:

bd($page->hero_items)

...and you would have seen what $page->hero_items was and why your if/else did not work ? 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...