Hi,
We have an unusual issue, we have several templates with both single and multi selection’template variables’, while they post selections to the public site one of our selection variables fails to store the setting with the admin UI. So if the client edits a documents using the TV they will need to select the TV every time otherwise the value will be set to null.
This courses major head-aces for our client, as the lose settings and often lose important inclusions for special site menus.
Is this a known problem, is there any fix.
Regards,
M
-
☆ A M B ☆
- 2,475 Posts
This doesn’t sound like a common problem...
Can you set a default value for the template variable? You’d do this in the control panel on the page where you created and named the template variable. This is a good option if ALL instances of that variable can have the same value (e.g. yes/no).
If each instance of the template variable needs to have a unique value depending on the page that it’s on, then the solution is a bit trickier, but what I’ve read about other people doing is writing a simple plug-in. If you haven’t dealt with plug-ins before, they’re just like Snippets (i.e. bits of PHP code), except instead of being executed when a page loads, they get executed when a certain event happens. You can use a plug-in to validate the user input in the manager -- you can check the value for a given template variable and if it’s empty (for example), then you can calculate a default value for it before you save the document.
Search the forums for template variables and plugins (or plug-ins) and see if you can’t find some threads where this technique was discussed.
Does that help? I hope so...
How is the TV setup and what kind of TV is it? How is the Output Widget setup? For multiple options I think a delimited list is needed.
hi, the template variable uses the "DropDown List Menu" with Input Option Values separated with ||. The Widget has been set to null "not selected".
Do I need to set a default? and how would I do this?
Thanks for the info Everett,
Everything seems to be correct in regards the set-up. I can only guess I’m experiencing a bug.
Any idea on how I resolve the bug?
-
☆ A M B ☆
- 2,475 Posts
Can you please post EXACTLY how you have the TV set up? The name, description, default, type, widget, EVERYTHING.
Then post for us EXACTLY what you are entering into a page for that variable?
I just can’t tell what you might be experiencing without the EXACT details.
Thanks!
Hi Everett,
The TV has been set as follows (please view image)
http://www.sandersdesign.com/modx-webpostimages/error.jpg
I’m using 0.9.6.3.
Thanks for the help
I think you need the Widget: set to Delimited List
Also try the Input Option Values: without breaking them onto a line each.
Thank, I’ve removed the line breaks and all is good. Thanks for the feedback. One to remember for future ref