I didn't exactly just start using ProcessWire. But does anyone know how would I go about retrieving the pages with a certain tag into separate sections based on their parent? Problem lies in the fact that both photos and featurettes (videos) share the same tags, and their thumbnails have a different aspect ratio. Which is pretty much why I'd like to have them separated, if a certain tag has been used on both content types. Parent names are "photos" and "featurettes".
Needless to say, the current code isn't really good nor a beauty to look at. But I've attached it, and I'd appreciate any help.
$thisTag = $page->title;
$tdsphotos = wire("pages")->find("tagsx.title=$thisTag, limit=8, sort=-created");
$pagination = $tdsphotos->renderPager(array(
'nextItemLabel' => "Next",
'previousItemLabel' => "Prev",
'listMarkup' => "<ul class='pagination'>{out}</ul>",
'itemMarkup' => "<li>{out}</li>",
'linkMarkup' => "<a href='{url}'>{out}</a>"
));
echo "<div class=\"littleboxes\">\n";
foreach($tdsphotos as $tdsphoto){
$otep = $tdsphoto->images->first();
$thumb = $tdsphoto->images->first()->size(210, 210);
$out .="<div class=\"inabox\">";
$out .="\n<a href=\"{$tdsphoto->url}\"><img alt=\"{$otep->description}\" title=\"{$otep->description}\" class=\"img-thumbnail img-responsive\" itemprop=\"thumbnailUrl\" src=\"{$thumb->url()}\" width=\"{$thumb->width}\" height=\"{$thumb->height}\"></a>";
$out .="<h6 itemprop=\"name\"><a href=\"{$tdsphoto->url}\">{$tdsphoto->title}</a></h6>";
$out .="\n</div>\n"; }
echo $out;
echo "</div>\n";
echo $pagination;
Thanks!