I am developing a v9 site and would like to tag blog posts with a product so I can show a filtered page list of blog posts on each product page.
My first thought was to set up a topic category with topics for each product and tag each blog post with the relevant product topic. This would be straight forward to set up and easy to manage with the built-in Page List options but I am mindful when handing over the site to be managed by someone else it is not the most intuitive.
I came across an excellent package by Mesuva, Multiple Page Selector Attribute which adds a new attribute where related pages can be selected using a popup sitemap view which would potentially take the Topics requirement out of the equation. Anyone could then add a new blog post and tag as many products as required from the sitemap without having to worry about setting up a new topic.
I have started to look at options for listing and sorting pages using an embedded Page List which has great flexibility for filtering by Custom Attibutes. When I add this new attribute and set this filter I cannot seem to set it up to work correctly. I believe this is because the attribute stores the related pages as an object so when I try to check if the current page ID (integer) is in the custom attribute (object) there is a type mismatch.
Does anyone know if this would be technically possible or if I am better off sticking with the Topic approach? Theoretically at least Topics themselves involve comparing a single Topic with a list of topics so there must be a way of mirroring that in some way? I am sure that it would require some custom SQL query rather than built in filters e.g.
$pageList->getQueryObject()->where("ak_attribute_handle LIKE '%\n" . $c->getCollectionID() . "\n%'");
but any pointers would be gratefully recieved.
Thanks for your help.
Paul