Does shopify support checkboxes with a dynamic source?

Topic summary

A user is attempting to create unique, product-specific accordions in Shopify’s Sense theme using metafields. Their approach involves creating metafields for accordion title, description, and visibility (True/False type).

Core Issue:

  • The checkbox field in the theme settings lacks a “dynamic source” button, raising questions about whether Shopify supports checkboxes with dynamic sources.
  • The user tried adding a simple checkbox setting in the schema but encountered limitations.

Proposed Solution:

  • Another participant suggests using a metafield (instead of a theme setting checkbox) to control accordion visibility.
  • They provide specific metafield configuration details and code snippets showing how to conditionally display accordions based on the metafield value.

Remaining Challenge:

  • The original poster notes they need to handle multiple accordions per product, not just one, suggesting the proposed solution may need further adaptation.

The discussion remains open with the implementation approach still being refined.

Summarized with AI on November 19. AI used: claude-sonnet-4-5-20250929.

I am trying to create unique accordions for my product page with the Sense theme so that each product has its own unique accordions. I am not sure if this is the best way to do it, it might not be. However the way I am trying to achieve this is by creating metafields for each product with an accordion title and description and visibility. The visibility metafield is of type “True or False”.

However I noticed, that the checkbox I created does not have a dynamic source button. Is this because Shopify doesn’t support checkboxes with dynamic sources?

I tried to add a simple checkbox setting schema:

{
          "type": "checkbox",
          "id": "show_accordion",
          "label": "Show collapsible row",
          "default": true,
          "info": "Check this to show the accordion"
        },

Here I add the if statement so it only shows the accordion if the Show accordion setting is enabled.

{% if block.settings.show_accordion %}
                          
              
                
              

  
            {% endif %}
1 Like

Hi @Kochjar

You can add a metafield to handle the show accordion as well.

Create a metafield with the following settings below

Then change the accordion code in your main-product.liquid

{% if product.metafields.custom.show_accordion %}
                          
              
                
              

  
            {% endif %}
1 Like

However I have multiple accordions not only one.