On ModX 2.2, I have a simple TV with Input Type Text and I wanted to setup a @binding to generate a dynamic default value pre-filled for the manager form.
To test it I tried to use @EVAL returning a string - @EVAL return "hello world"; - but what I got as default value on the input form element is actually the whole @EVAL binding as it was a normal string.
I've tried it with a Listbox Input Type and it actually works.
I checked and rechecked the documentation and all available resources online, but there seems to be no mention of @bindings being available only for certain Input Types. Because nobody seems to be coming across this issue, I'm guessing that either i'm doing something wrong or it's bug (or undocumented feature).
Can anyone give me a help? Or else point me in the right direction?
Thanks.
-
☆ A M B ☆
- 24,524 Posts
The raw default value is what is displayed on the form. What the value evaluates to is what is displayed using the TV tags on the front-end. This is expected behavior.
Ok. What I was thinking is that the default value @binding for that Input Type would get the values right there on the manager Form, like when you populate a dropdown list with a @binding. I actually need to calculate that default value dynamically so I was thinking I could take a shortcut by using @bindings.
[ed. note: koriolis last edited this post 13 years, 3 months ago.]
-
☆ A M B ☆
- 24,524 Posts
No, the intention is that the editor sees actual raw default value and edits it as he sees fit.
You could use a checkbox, with it checked by default. Or even hide the whole thing, if it's not supposed to be edited. In which case, why use a TV? A snippet would be more efficient.