How to access id in settings schema with custom variable

Hello there,

Is there a way to access liquid section id dynamically with custom variable

( something like: {{ section.settings }}.{{ custom_variable }} )

I am looping through a menu links and each link.title (plus additional formatting) is an actual the id in my json schema.

I want that link.title to use as suffix to the section.settings to access my id

{% for link in section.settings.menu.links %}

{% assign image = link.title | handleize %}
{% assign image_title = image | append: ‘-image-title’ %}
// Here I would print an actual result

{{section.settings.link-name-image-title}}

{% endfor %}

Is something like this possible? I would really appreciate any help, thank you!

@choky Hope you are doing well.

Could you please explain in a bit more detail?

this is what I have in my list (Chemicals, Pool Equipment, Spa Equipment etc…)

In my json schema I have same amount of text settings for each list item

{
“type”: “text”,
“id”: “chemicals-image-title”,
“label”: “Chemicals Image Title”
},

{
“type”: “text”,
“id”: “pool-equimpent-image-title”,
“label”: “Pool Equipment Image Title”
},

{
“type”: “text”,
“id”: “spa-equimpent-image-title”,
“label”: “Spa Equipment Image Title”
}
(and so on)

When I loop through the links, I manage to get those IDs

{% for link in section.settings.menu.links %}

{% assign image = link.title | handleize %}
{% assign image_title = image | append: ‘-image-title’ %} // here I get on each iteration (chemicals-image-title, pool-equimpent-image-title, spa-equimpent-image-title…) which is exactly the id in my json schema
Now I need a way to concatenate image_title to “section.settings” so I can get the actual value.

{{section.settings.chemicals-image-title}}

// this is just example of first link that needs to look like in the end

{% endfor %}

@choky Yes, it is tricky but interesting.

Can take a look at your theme code? got your point what would you like to implement.

can help with you this.