Question:
I am using the following code to show or hide buttons for links based on presence of links in CMS data and it is working 100%. However, instead of hiding the buttons if no URL, I would rather show them as dim so the format of page looks more consistent. Any thoughts on how to do this?
Product:
Editor X
What are you trying to achieve:
Dim buttons w/o links in CMS
What have you already tried:
Nothing
Additional information:
None
β button.enable()
β button.disable()
β button.enabled
β button.disabled
In the code editor, Velo is not recognizing .button
SET:
$item(β#yourButtonIDhere).enable();
$item(β#yourButtonIDhere).disable() ;
GET:
console.log($item('#yourButtonIDhere).enabled);
And the last one was b u l l sβ¦ not existent β¦
β button.disabled
I am a bit new to Velo so I apologize if I am being slow. Velo is also not recognizing .enable() and .disable()
Why β $w ??? β> your button is outside of REPEATER ?
Or did you want β $item β because your button is INSIDE of REPEATER ?
About enable() and disable()β¦
Button is inside repeater was just experimenting since the .enable() and .disable() methods were not recognized in editor. Not sure what to do here.
Maybe it depends on the TYPE of BUTTON.
Maybe not every button supports this functionality β i did not test this.
Maybe the CODE-AUTOCOMPLETION is buggy and is showing you wrong information.
Test the button and see if it gets GREYED-OUT.
If not β take another button β ORDINARY-ONE and test again.
Also check the ID of your BUTTON one more time.
Hold your mouse over the red underlined code-section and see what kind of ERROR you get.
DEBUGGING only works with INPUTS and OUTPUTS andβ¦ ??? β> YES and β CONSOLE-LOGS.
Ok and thanks for your patience - just learning Velo. These are images of things like YouTube logos with links to URLs. Also tried Opacity setting which is also not compatible with image elements.
I know, i am watching a lot of posts. 