Dawn Theme Slideshow Image Link without button but use button on others

Topic summary

A developer is customizing the Dawn theme’s slideshow to make images clickable via links, but encounters a conditional logic issue.

Current Problem:

  • Successfully implemented clickable slideshow images using a tutorial from websensepro.com
  • When a slide uses a button instead of a direct link, leaving the link field empty still makes the image clickable
  • Empty links cause the page to reload instead of allowing button interaction

Desired Solution:

  • Need an if statement that checks whether a link exists for each slide
  • If no link is present, the clickable overlay should be disabled, allowing the button to function normally
  • Only slides with populated link fields should be clickable

Status: The developer acknowledges this is likely a simple conditional check in Shopify’s Liquid templating but is seeking help with the correct syntax or implementation approach.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

I’ve added a link to my clients slideshow to make the image clickable but I’ve run into an issue with it and just need a little help with the if statement.

I only want images with the link to have the link but currently if I don’t put a link in the second image, which is using the button. When I don’t put the link in for the slide that has the button, the image is still clickable but it doesn’t have the link so it just reloads the page. I’d like to have the if statement in there so that if the image doesn’t have a link added, it will ignore that field and will allow the user to click the button instead.

I’ve added the link snippet found here https://websensepro.com/blog/how-to-make-slideshow-clickable-in-shopify-dawn-theme/ and it works great but want to be able to hide the link if empty.

I know this is probably something pretty simple but for some reason I’m having trouble remembering how this is achieved in Shopify themes.