Thanks Bob - Thanks for the code example - Afraid I dont think it will work as I dont think my explanation of what I need was clear enough - the use of TV1, TV2 was just to force getResources to inlclude the data of those TVs in the TPL that getResources uses to display the results - they are nothing to do with the selection of which resources to output as results. Below is the full call with all TV names as I am using them - I had made them general to help try and make it simpler to follow - so please ignore previous and use these blocks of code as what I am using:
[[!getCache? &element=`getResources` &resources=`[[*ELEMENT-WorkIndex-Top10Featured]]` &tvFilters=`ELEMENT-2019Project-WorkIndexSelections==%729%` &tpl=`ELEMENT-2019Work-Grid-ProjecTpl` &depth=`0` &limit=`10` &includeTVs=`1` &processTVs=`0` &tvPrefix=`` &sortby=`RAND()` &first=`15` &dummyproperty=`[[!SessionIDContents]]` &includeTVList=`ELEMENT-2019Project-WorkIndexCoverImage,ELEMENT-2019Project-WorkIndexProjectBlurb` ]]
And ELEMENT-2019Work-Grid-ProjecTpl code is:
<!-- ITEM -->
<div class="workIndexGridItem">
<div class="workIndexGridItemProjectDeets">
<a title="Read more about [[+pagetitle]]" href="[[~[[+id]]]]">
<h4 class="workGridTitle">[[+pagetitle]]</h4>
<p class="workGridSubtext">[[+ELEMENT-2019Project-WorkIndexProjectBlurb]]</p>
</a>
</div>
<div class="workIndexProjectImageWrapper">
<a title="Read more [[+pagetitle]]" href="[[~[[+id]]]]"><img src="[[+ELEMENT-2019Project-WorkIndexCoverImage]]" alt="Read more about [[+pagetitle]]" title="Read more about [[+pagetitle]]" class="workindexProjectImage"></a>
</div>
<!-- Mobile text -->
<div class="workIndexGridItemMobileText">
<a title="Read more about [[+pagetitle]]" href="#">
<h4 class="workGridTitle">[[+pagetitle]]</h4>
</a>
</div>
<!-- end of Mobile text -->
</div>
<!-- end of ITEM -->
So - What I want in a nutshell - is to get GetResources to look at the contents of the TV called “ELEMENT-WorkIndex-Top10Featured” - which contains a comma sperated list of IDs, and then look at each of those resources from their IDs and check the value of TV called “ELEMENT-2019Project-WorkIndexSelections” (which again is a comma seperated list of IDs) and ONLY output them as results IF they match the value of TV “ELEMENT-2019Project-WorkIndexSelections” as written in the getResources call. So in this example, let say TV “ELEMENT-WorkIndex-Top10Featured” has a value of “10,20” - getResources looks at resources with ID 10 and 20, and looks at the TV “ELEMENT-2019Project-WorkIndexSelections” for each, lets say resource ID 10 has value of 730 for “ELEMENT-2019Project-WorkIndexSelections” and resource ID 20 has value of 729,730. This would mean, that getResources should output just resource ID 20, as this is the only resource ID from TV “ELEMENT-WorkIndex-Top10Featured”, that has TV “ELEMENT-2019Project-WorkIndexSelections” value matching the one on the call - e.g. 729.
What currently happens, is that getResources outputs BOTH resource IDs 10 and 20… so the scruntinising of TV “ELEMENT-2019Project-WorkIndexSelections” is not working…
Does that make sense?
Bruno - thanks for you example - I cant seem to work out how that would work in practice - any chance of an example? Would that approach work with the updated scenario i have outlined in this post?
P.S. Just had a play and got the “ELEMENT-2019Work-Grid-ProjecTpl” Chunk template to out the value of the resources TV “ELEMENT-2019Project-WorkIndexSelections” and its displaying as “729||730||740” rather than comma seperated as I have instructed that TV to output with… ? Is this the underlying issue perhaps? When I view the value of TV “ELEMENT-2019Project-WorkIndexSelections” on the actual resource front-end page it shows as “729,730,740” e.g. comma seperated…???
Also, If I change the getResources call to update
&tvFilters=`ELEMENT-2019Project-WorkIndexSelections==%729%`
to become
&tvFilters=`ELEMENT-2019Project-WorkIndexSelections==ABC`
Nothing changes… still outputs the same resources… so I dont think the &tvFilters element is doing anything!