<![CDATA[ Disappearing template variable values on resource - MODX Community Forums]]> https://forums.modx.com/thread/?thread=99037 <![CDATA[Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=3#dis-post-535513
@EVAL return $modx->runSnippet('listMyResources',array('parent' => 26));


to populate the drop down with categories pulled from a list of resource page titles.

Everything works, i.e. the categories appear in the TV drop-down on the resources to be categorised, and when selected and the resource is saved the selection is saved in the database, BUT on page refresh the chosen categories disappear from the TV field on the resource that has been categorised. The category selection is still there in the database, but is no longer visible on the resource.

Does anyone know how to stop the TV selection disappearing after page refresh?]]>
cottagestuff Dec 07, 2015, 08:15 AM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=3#dis-post-535513
<![CDATA[Re: Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=3#dis-post-561096
I have had issues with my hoster, where their rules get triggered when I try to save snippets templates or chunks, where saving is impossible. You might want to ask them if there were any errors around that time.

But, I don't think we need to assume the problem is the same as what I had, let's get all the evidence out to solve this one]]>
nuan88 Aug 25, 2018, 12:21 PM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=3#dis-post-561096
<![CDATA[Re: Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=3#dis-post-561086 Exceleron Aug 25, 2018, 04:21 AM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=3#dis-post-561086 <![CDATA[Re: Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-561083
or possibly your hoster will have errors]]>
nuan88 Aug 25, 2018, 12:16 AM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-561083
<![CDATA[Re: Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-561081
Let me break it down a little further. So we are using have series of casestudies, some are for multiple crops. So we have a container page that has all of these studies under them. In each study we have this EVAL call to pull all the crops that they can be tagged if you will with the related casestudies.

What is happening we select them, save, and go back and the checkboxes, or multiselect list is blank. It is as if we never checked them.

Check and Saved

When I reopen the file
]]>
Exceleron Aug 24, 2018, 06:16 PM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-561081
<![CDATA[Re: Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560729
[[Wayfinder?
   &rowTpl=`MyRowTpl`
   &startId=`0`
   &level=`4`
   &sortBy=`pagetitle`
   &sortOrder=`ASC`
   &contexts=`web`
   &ignoreHidden=`0`
   &where=`{"template:=":7}`
]] 


If necessary, you could use TVs for the values above.

The rowTpl would look something like this:

<li><a href="[[+wf.link]]">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>

]]>
BobRay Aug 13, 2018, 08:38 PM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560729
<![CDATA[Re: Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560714 Quote from: BobRay at Aug 09, 2018, 03:31 AM
Create a snippet with this code from your TV (reformatted -- it has to be on one line in the TV):

return $modx->runSnippet('getResources', 
   array(
      'parents'=>'0', 
      'showHidden'=>'1', 
      'tplFirst'=>'tvInputOptionsFirstTpl',
      'tpl'=>'tvInputOptionsTpl',
      'context'=>'web',
      'limit'=>'0', 
      'depth'=>'4', 
      'sortby'=>'pagetitle', 
      'sortdir'=>'ASC', 
      'where'=>'{"template:=":7}'
    )
);


Put a tag for it on a page and see what it returns.



This is the out put:

ALMOND==77 ||Bell Peppers (Solanacae)==18 ||Blueberry==24 ||CITRUS==13 ||Grapes==25 ||Lettuce==20 ||Onions (Herbacae-Lilacae)==19 ||Peanuts==26 ||PECAN==15 ||Squash / Cucurbit==21 ||Standard Veggies==17 ||STONE FRUIT==14 ||Strawberry==23 ||Tomato==28 ||Turf & Ornamentals==29 ||Watermelon (Curcubit)==27 ||YOUNG PERENNIAL==12]]>
Exceleron Aug 12, 2018, 04:58 PM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560714
<![CDATA[Re: Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560541
return $modx->runSnippet('getResources', 
   array(
      'parents'=>'0', 
      'showHidden'=>'1', 
      'tplFirst'=>'tvInputOptionsFirstTpl',
      'tpl'=>'tvInputOptionsTpl',
      'context'=>'web',
      'limit'=>'0', 
      'depth'=>'4', 
      'sortby'=>'pagetitle', 
      'sortdir'=>'ASC', 
      'where'=>'{"template:=":7}'
    )
);


Put a tag for it on a page and see what it returns.

]]>
BobRay Aug 09, 2018, 03:31 AM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560541
<![CDATA[Re: Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560529 Quote from: BobRay at Aug 06, 2018, 07:23 PM
Is there a tag that displays the TV's content?

You might try switching to pdoResources (in the pdoTools extra), though I'm not sure it will make a difference.

You're not using CacheMaster by any chance?


Hey Bob, I tried pdoResources no change. I am not using CacheMaster either. Do you think I should?
FYI help me solve this and my &where filter problem and the Beers are on me....

Thanks Ryan]]>
Exceleron Aug 08, 2018, 04:02 PM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560529
<![CDATA[Re: Disappearing template variable values on resource]]> https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560446
You might try switching to pdoResources (in the pdoTools extra), though I'm not sure it will make a difference.

You're not using CacheMaster by any chance?

]]>
BobRay Aug 06, 2018, 07:23 PM https://forums.modx.com/thread/99037/disappearing-template-variable-values-on-resource?page=2#dis-post-560446