Orchard
Orchard copied to clipboard
It is not possible to use tokens with Options text in Enumeration Element
Currently Options property in an Enumeration Element expects you separate text from value with two colon: "Option 1:1". So it splits each line using character ':' Problems arise when you want to use a token to get text of the option and this token needs a parameter because it also uses a two point character ':'. So it would better Enumeration element expects a different character than ':' like for example '|'
Perhaps both characters need to be supported as to not break existing sites that use the colon?
So it could look for '|' char and if not exist try with old one. Is it ok?
Exactly.
PR fixed
What is the text or the value needs to contains a |
, will I need to create a PR to use a different char?
I think the solution is to encode the :
and to be explicit in the description to use ::
to render one.
@sebastienros the use-case @jersiovic mentioned above is the usage of a token - I'd prefer your recommendation too btw, because it doesn't break existing configuration (when token's aren't used).
Wan we switch the element to use |
but it would mean to create a migration too.
Actually, we can detect that a :
corresponds to a Token and not a separator, because Tokens are between {
and }
characters. So we might be able to implement this without having to change what you type in the field, just make the deserialization smarter.