All things Shopify and commerce
How can I dynamically display the block name as the block type for each social link in this section, instead of using icons or the standard social type?
Add 'Social Name' in 'name' instead of 'social_type'
- 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.
Yes, I can do that, but I want to show the related social name for that instance in the block
This is what I intend to achieve: using the social name in the block to avoid having the same label for all the social links.
In the block section, I am getting the social_type in the Social Name field, but I’m unsure how to dynamically populate the name block with this social_type value.
Any help would be appreciated!
tks!
To dynamically display the block name as the block type for each social link, rather than using icons or standard social types (like Facebook, Twitter, etc.), follow these steps:
Each social link should be stored as a block or object, typically with attributes like name (the custom label for the social link) and type (the standard social media type, like 'Facebook' or 'Twitter').
Instead of displaying the icon or the default social type, use the block’s name attribute to replace the type. In code, you can dynamically inject the block name into the HTML or template.
If you're handling social links with JavaScript, here’s an example of how you might swap the social type for the block name:
In this example, the name (e.g., "My Business Page") replaces the icon or social media type in the rendered section.
If you're using a templating engine (like Handlebars, Django templates, or others), replace the block where you usually show the icon with the dynamic block name.
Here, {{name}} dynamically displays the block name for each social link.
Since you're not using icons, ensure that your custom block names are styled appropriately. Use CSS to make the names visually appealing in your section.
Ensure the section still looks good across different devices and screen sizes. Since you're displaying text instead of icons, adjust font sizes or layout as needed.
By accessing the block name and dynamically replacing the default social type or icon, you can create a personalized section for social links. This method allows you to display custom names or labels for each link, giving you more flexibility in how you present social connections.
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