Getresources not showing tpl content

I have this getResources implementation

[[getResources? &parents=10 &limit=0 &tpl=videos_tpl &sortby=menuindex &sortdir=ASC]]

the issue is that inside the tpl videos_tpl is not working the template variable just the pagetitle

<p>[[+pagetitle]]</p>
<div class="jetpack-video-wrapper">
<span class="embed-youtube" style="text-align:center; display: block;">
[[+youtube]]                                    
</span></div>

can someone help me please

For template variables you have to use the prefix tv.:

[[+tv.youtube]]

this youtube have to be a chunk or a template variable?

Can be a template variable, but getResources looks for template variables with a prefix of tv. If you don’t use that prefix when you name your template variables, then you can just add

tvPrefix=``

parameter in your snippet call. That way you can name your template variables whatever you want with no prefix.

As far as I am aware you need to indicate what TV’s to process, try:

[[getResources? 
&parents=`10` 
&limit=`0` 
&tpl=`videos_tpl` 
&sortby=`menuindex`
&sortdir=`ASC`
&tvPrefix=``
&includeTVs=`youtube`
&processTVs=`youtube`
]]
1 Like

In getResources, the &includeTVs property is boolean, (default is 0) so needs to be set to 1 if including template variables.

In pdoResources the &includeTVs property is a comma-separated list of template variable names to be included.

Trips me up every time. (Maybe it won’t now that I’ve written this out.)

thanks, this was the solution that works for this case.