discuss.answer
-
- 24,544 Posts
It sounds like a cache issue.
Can you post the full tag that shows the list?
-
- 91 Posts
Bob, yes, you are right, it does seem to be a caching issue. Just tried saving a new selection of template values on a resource, then refreshed the page and saw again that the new selection is not being shown in the field on the resource. But after deleting all the cache folders for the core in CPanel, then refreshing the page, the TV values appear.
Is there some way of stopping the caching of those TV values when setting up the template variable?
-
- 24,544 Posts
Can you post the full tag that shows the list?
-
- 24,544 Posts
No, I meant the MODX tag that goes on the page where the list appears. It looks like exside may have solved your problem, though.
Note that his code will be faster, but will only work if the children are immediate children (iow, there are never any "grandchildren").
-
- 91 Posts
Thank you, Exside, for improving the snippet and correcting my omission of the option==value pairings. You said that the TV wouldn't have known what to save in the database, but I could see from PHPMyAdmin that the right selections were being saved in the database; they just weren't being shown on the resource in the manager area after page refresh. Now I am using exactly the snippet you suggested (definitely better), the right options are being shown in the drop-down list on the resource, and the selections are being saved to the database. They still disappear on the resource (not the database) on page refresh.
Bob, the list of categories is pulled from a list of resource pagetitles that are children, where there are no grandchildren.
There is no tag used in a template for the front end of the website. This is a TV used simply to categorise resources so that they can then be searched using a TVfilter with getResources, which works.
It seems to be a browser issue. I am using Firefox (version 42.0, apparently), and if I press CTRL-F5 the right TV values appear in the resource. Odd that other TV values show normally without having to use CTRL-F5. Guess it is a purely Firefox issue, not a MODX bug or something missing from the snippet.
Thank you again, Bob and Exside, for the help.
-
- 534 Posts
That's weird indeed, does it work on chrome? When I read your first post I actually was thinking (when finding the non-value issue) how the right value got into the db anyways^^...
-
- 91 Posts
Sorry for the delay in replying. No, the weirdness disappears in Chrome. Stupid of me not to check in a second browser right at the beginning. I checked IE after Bob's suggestion and saw that in IE the TV field on the resource page was working normally, so it clearly was a problem with Firefox, not with MODX. As for the database getting the necessary information, clearly the snippet only needs to get one value, which is then assumed to hold for both the bits of the value-option pair in the selection drop-down list.
Thanks again for taking the time to help.