Okay I searched the forums for at least an hour before posting this. If it’s been answered elsewhere I can’t find it.
Is there any way to set the default value for a template variable as a document attribute variable?
ie:
default value: [*menutitle*]
I’ve tried this and it doesn’t work. Looked at bindings and can’t quite figure how to use an @select to get the job done. I was hoping there was a straightforward way to do it as in my example and that I just had the syntax wrong or something.
Thanks!
Sorry to come back to this after a few weeks, but I am just noticing now that this is not working for me.
For some reason it does not seem to be parsing the @EVAL statement.
When I create a new resource and look down at the TV field instead of pulling the value from "menutitle" as expected it just has the @EVAL code.
ie:
Class Value: @EVAL return $modx->documentObject[’menutitle’];
I’m expecting it to be
Class Value: "Menu Title" (whatever the menu title happens to be for that resource)
Am I missing something?
Is there a setting I need to check in order for @EVAL to be parsed?
Have a look at the frontend of the document - in the manager AFAIK you will alway see the "code" of the TV...
Greetz
JUSI
I’m confused by why you need the TV because, AFAIK, [*menutitle*] is available any where the TV would be and it’s already set.