Hi,
I have a collection, and each child contains various TVs.
The Getresources Call I'm using in the template is this:
<ul class="videogallery">
[[!getResources?
&parents=`[[*id]]`
&tpl=`VideoTpl`
&showHidden=`1`
&limit=`100`
&processTVs=`1`
&includeTVs=`1`
&includeTVList=`YouTubeID,YouTubeID2`
]]
</ul>
The TPL chunk I'm using to render the list of child resources is this:
[[+tv.YouTubeID2:isempty=`
<li>
<a href="
http://youtube.com/watch?v=[[+tv.YouTubeID]]&autoplay=1" title="[[+pagetitle]]">
<div style="background:url(
http://img.youtube.com/vi/[[+tv.YouTubeID]]/0.jpg) no-repeat center / cover;"></div>
<p>[[+publishedon:strtotime:date=`%b %Y`]]</p>
<h2>[[+longtitle:ellipsis=`27`]]</h2>
<span><p>Watch:</p><h3>“[[+longtitle]]”</h3></span>
</a>
</li>
`]]
[[+tv.YouTubeID2:notempty=`
<li>
<a href="[[~[[+id]]]]"title="[[+pagetitle]]">
<div style="background:url(
http://img.youtube.com/vi/[[+tv.YouTubeID2]]/0.jpg) no-repeat center / cover;"></div>
<p>[[+publishedon:strtotime:date=`%b %Y`]]</p>
<h2>[[+longtitle:ellipsis=`27`]]</h2>
<span><p>Watch:</p><h3>“[[+longtitle]]”</h3></span>
</a>
</li>
`]]
So basically it's seeing if I have more than one video (YouTubeID2) - if I do, it renders the second <li> and opens the resource as a page, but if YouTubeID2 is empty, then it open the first video in a modal window. All good so far, although I'm sure the above could be simpler!
But, for some reason, the contents of YouTubeID2 is being rendered in between my list items, so if I view my source code i can see stray TVs being printed:
<li>
<a href="
http://youtube.com/watch?v=tamQQ-z12H0&autoplay=1" rel="prettyPhoto" title="GLA Report">
<div style="background:url(
http://img.youtube.com/vi/tamQQ-z12H0/0.jpg) no-repeat center / cover;"></div>
<p>Feb 2016</p>
<h2>GLA Report</h2>
<span><p>Watch:</p><h3>“GLA Report”</h3></span>
</a>
</li>
czkdxpdwBOM <---- stray TV value!!
<li>
<a href="media-centre/videos/uber’s-lobbyist-campaign-against-tfl-safety-proposals/" title="Uber’s Lobbyist campaign against TfL safety proposals">
<div style="background:url(
http://img.youtube.com/vi/czkdxpdwBOM/0.jpg) no-repeat center / cover;"></div>
<p>Feb 2016</p>
<h2>Uber’s Lobbyist campaign against…</h2>
<span><p>Watch:</p><h3>“Uber’s Lobbyist campaign against TfL safety proposals”</h3></span>
</a>
</li>
WbkcvXu8sAk <---- stray TV value!!
<li>
<a href="media-centre/videos/taxis-banned-from-tottenham-court-road/" title="Taxis Banned From Tottenham Court Road?">
<div style="background:url(
http://img.youtube.com/vi/WbkcvXu8sAk/0.jpg) no-repeat center / cover;"></div>
<p>Feb 2016</p>
<h2>Taxis Banned From Tottenham…</h2>
<span><p>Watch:</p><h3>“Taxis Banned From Tottenham Court Road?”</h3></span>
</a>
</li>
Any ideas why this is being rendered at all?!
Confused!
Thanks
Andy