Same snippet used again - unique values impossible

Hi! I have created a list of pronouns as a dropdown that can be used across multiple snippets by importing it.
However, if I use it multiple times in one snippet, it substitutes the last chosen values for all instances.
e.g., Fortunately, {import: /pronoun} seems to have a relatively minor problem. {import: /pronoun} requires xxx but {import: /pronoun} has to do yyyy.
Once you change any of the imports, all values become the same. which leads to him, he, and He being misused or the feminine equivalent or the plural they, them, their.
I did see Apply gender to whole snippet based on one toggle? for similar issues.
But I can't figure out how to have a say if I choose he, then I may want to use him or He in the second or third instance.

Hey @nathanir ,
Sorry for the delayed response.

I think the formmenu is using the name attribute, which is making the snippet to reflect changes from one dropdown to another. You can remove it and try once.

{formmenu: default=he; she; they}

You can remove it from by pressing "x" button

Sorry, I may not have been clear.
I am trying to create a master category in which this snippet is placed as Pronouns.
I am trying to import it into an entry in another snippet in its folder. When I choose to say he or she once, all other instances become compulsorily he or she. I want to have the choice of once I choose him in one place, I should be able to pick him or his later in the same snippet.
.

@nathanir ,
Yes I understand it correctly. Please try removing the name setting on the dropdown and it should work as you expected.

The name setting on the dropdown makes sure you use same value for the name across the snippet. But if it does not have a name, every form behaves independently.

You can read more about this setting here.

If it doesn't please share the sample snippet both including master and regular snippet which does not work for you so I can help you better. Please make sure you remove any sensitive information before sharing.

Thank you, if I remove the name, I can choose different pronouns. Now my problem is how do I capitalize some instances?
e.g. Fortunately, {formtext: name=FirstName} seems to have a relatively minor problem. {formmenu: default=he; she; him; her; they; them; their; his; formatter=capitalized} requires xxxx. The xxxx is minor and {formmenu: default=he; she; him; her; they; them; their; his} needs to yyyy.
I want the first instance to be capitalized as it is at the start of the sentence and the second one to be regular.

Can you have two snippets one say /pronoun and another /proper-pronoun which will have different formmenu.

If you want to keep the list from the same source.
You can do this.

{pronoundata=["he", "she", "him", "her", "they", "them", "their", "his"]}

{formmenu: values={=pronoundata}} {import:/data-pronoun}

{formmenu: values={=pronoundata}; formatter=(v) -> proper(v)} {import:/data-pronoun}

This is wonderful! It sorts out the problem of using different values from the same source and formats it correctly. Thank you very much!

1 Like