Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I have 2 sections that are included on the same page, and in section 1, I have a button that I want to set the href to #section_2.
It works if I manually paste the dynamically generated section id of section 2 as href, but it seems that shopify would dynamically generate this id and it might change (not sure when it would regenerate), which will break this functionality.
Therefore, I am looking for a way to get the dynamically generated section id programmatically and pass that as the href to avoid potential breakage.
Thanks
Hi @Alexweee
Shopify automatically generates an ID each time you create a new section. But you can customize the liquid code of the section and wrap all the code of into your dynamically ID
<div id="your-dynamically-id">
// code of your section' file
</div>
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
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