I am having trouble outputting my tagging system correctly. Each music track has a Multi-Page-List-Select field-type which tags associated categories.
Tags is a parent page with nested categories beneath. Genre, Mood, Drum Tags each contain additional categories which are ultimately the tags I am associating on the music tracks.
In the code below. $genres is where I am having trouble. I think my selector is correct, but my chaining is wrong?
// Find Songs
$tracks = $pages->get("/Music/")->find("template=track, parent.title!=Drums");
foreach ($tracks as $track) {
$track_html = "<li>";
$track_html .= "<a>{$track->title} </a>";
// FIND GENRES EACH TRACK BELONGS TO.
$genres = $track->tags->find("parent=genre");
// OUTPUT ONLY GENRES
foreach ($genres as $genre) {
$track_html .= $genre->title . " ";
}
$track_html .="</li>";
echo $track_html;
}
Thank you