Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi everyone,
I'm using the Ella theme, and my blog posts have a [sidebar] product block. I want to hide this block when there is no related product, but I'm not sure which Liquid file controls it.
I inspected the page using DevTools but couldn’t pinpoint the exact file where this block is generated. Does anyone know where I should look and how to modify the Liquid code to conditionally hide the block when no related product exists?
Thanks in advance for your help!
Solved! Go to the solution
This is an accepted solution.
Hi @DRHP ,
This be done by two ways.
1. If you know that few blog will not have any product for suggestions, you can create template with no sidebar and assign the relevant template to blog.
2. if its dynamic or products are coming based on some logic you have to validate the data and write condition to have full width.
Request you to share the .liquid file code to help you in this.
Hello, thanks!
This is the current link:
https://dr-rath-at.myshopify.com/
When clicking the main header button or any of the images under "Aktuell", you are redirected to a blog page.
Hi @DRHP
I hope you are doing well.
If you have article.json, then please check that you will have a section like main-article or something
You can check for main-article.liquid or similar file under sections and you will find sidebar
You can control from their using liquid condition
Thanks!
This is an accepted solution.
Hi @DRHP ,
This be done by two ways.
1. If you know that few blog will not have any product for suggestions, you can create template with no sidebar and assign the relevant template to blog.
2. if its dynamic or products are coming based on some logic you have to validate the data and write condition to have full width.
Request you to share the .liquid file code to help you in this.
I followed your first option and it works great. Don't know why I didn't think of this myself.
Thank you!!
Glad to know if works.
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025