Hi, I’m working on pulling in headlines and content from any page in my site based on a specific tag, that needs to change for each instance of the template.
Right now my php for this looks like:
<?php foreach($site->index()->filterBy('template', 'composition')->filterBy('tags', 'apparitions', ',')->flip() as $article): ?>
Which should then allow me to pull data from all my composition templates that are tagged “apparitions” - this works great, but, now I’d like to dynamically specify what tag is used to pull content. I attempted the following:
<?php foreach($site->index()->filterBy('template', 'composition')->filterBy('tags', '<?php echo $page->pulltag() ?>', ',')->flip() as $article): ?>
and added a pulltag element to my blueprint and /txt file but it’s not functioning (it’s just showing up empty)
Is there a better way I can be doing this? I’d rather not have to make a new template for each page, as that sort of defeats the purpose.
Right now the non-functioning code is plugged into this page: http://data.randy-gibson.com/projects/apparitions and the functioning to: http://data.randy-gibson.com/projects/apparitions_working
Thanks!