Extension builder JSON variables

This section can be used to submit suggestions for Extension Builder.
Note that this section is not monitored for support.
Forum rules
This forum section can be used to submit suggestions for Extension Builder.
Note that this section is not monitored for support.
Post Reply
wwonderfull
 
 
Posts: 1440
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Extension builder JSON variables

Post by wwonderfull »

I was reading instruction document of extension builder and had not found any JSON example. Just for experiment configuration was on a json which the js was fetching using the api.

{
"actionOne": $actionTwo$,
"actionTwo": $actionTwo$
}

for Boolean true false or others will the above method work Pablo? because I think it will throw a syntax error. I mean is JSON variables supported with the way extension builder works because I am not sure.
User avatar
Pablo
 
Posts: 22488
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Extension builder JSON variables

Post by Pablo »

I think this should work. Did you try?
wwonderfull
 
 
Posts: 1440
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Extension builder JSON variables

Post by wwonderfull »

Was testing got something like this

Code: Select all

{
  "animationEnabled": $animationEnabled$
}
Error fetching the configuration: SyntaxError: Unexpected token '$', ..."Enabled": $animation"... is not valid JSON
wwonderfull
 
 
Posts: 1440
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Extension builder JSON variables

Post by wwonderfull »

Oh figured it out pablo it had to be a string "$variable$" it works :D

Update: One thing I noticed is that when I was writing name for the property the name was being taken as the variable. In terms of css it was very useful in terms of JavaScript I had to delete the variable after writing it again Maybe we could have a checkbox so if enabled it will automatically take the value from name and if unchecked it will let us write freely Because Names are names can have space and others, but variables have a specific way of writing. What do you think pablo.

For example, Name: Enable Animation
the way it is now doing in extension builder is automatically making it like $enableanimation$ which should correctly be $enableAnimation$ as written in script.
Post Reply