A user created a custom tabs section for the Shopify Dawn theme and wants the backend editor to display the user-entered “Tab Label” text instead of the default “Tab” label when listing items.
Issue Clarification:
The tab labels display correctly on the frontend, but in the theme editor’s backend list, all items show as “Tab” rather than their custom labels (e.g., “Back To The Future”).
Solution Provided:
Modify the block’s name property in the schema to dynamically reference the tab_label setting:
I created a new section for my Shopify Dawn Theme to add Tabs and other items. Clicking “Add Tab” adds a Tab item with the label “Tab” but I would like to display the content from the “Tab Label” field instead of the text default text “Tab”.
Maybe my question was not clear. The correct Tab Label is displayed on the front end page but in the backend, it says Tab where it should say whatever the user entered in the Tab Label textbox. So in my image, if the user types “Back To The Future” in the Tab Label textbox, then instead of the first item in the Rollover List Tabs saying Tab, the first item would say “Back To The Future”. Is it a schema issue?
To display the user-entered “Tab Label” in the Shopify theme editor backend instead of the default “Tab,” you need to modify the block’s name property to reference the tab_label setting. Here’s how to do it:
Update the Schema:
Ensure your block schema includes the tab_label setting, which you already have:
Replace the static “name”: “Tab” with a Liquid template that pulls from the tab_label setting. The default: ‘Tab’ ensures it falls back to “Tab” if no label is provided.
Make sure the Liquid syntax is correctly interpreted in your theme’s JSON schema. Shopify may require specific formatting, so verify with Shopify’s Schema documentation.
Save and Refresh:
After updating the schema, save your changes and refresh the theme editor. The backend should now display the custom “Tab Label” entered by the user instead of the default “Tab.”
Summary: By dynamically setting the block’s name property to use the tab_label setting with Liquid, the backend will reflect the user-defined label, enhancing clarity and customization.