Hide Image-with text when Metafield picture or text is empty

Topic summary

User wants to add three “Image with text” sections to a Shopify product template, each driven by paired metafields (Image 1/Text 1, Image 2/Text 2, Image 3/Text 3). Objective: automatically hide each section if either the corresponding image or text metafield is empty.

Context: Shopify metafields are custom data fields attached to products; “Image with text” refers to a theme section that displays an image alongside text. The user has created six metafields (three image, three text) and needs conditional rendering logic in the template.

Status: The user is unsure how to implement the show/hide logic and asks for guidance. No solutions, code examples, or decisions are provided yet. Discussion remains open with the key question unanswered.

Summarized with AI on January 11. AI used: gpt-5.

I have tried but i really dont get it.

I have my product template.

On that i want to add 3 different

“image with text”

I will have 6 metafiled for this

like

Meta Image 1

Meta Text Image 1

Meta Image2

Meta Text Image2

Meta Image3

Meta Text Image3

If Image 1 or text image 1 is empty i want to turn of “image & text 1”

and the same with 2 and 3.

But i really dont understand how i should do this.

Can you please help me?