I am trying to get attachments to show on a category page that are appropriate to that category, to do this I am naming them with a ‘prefix’ I guess of that pages category so for example;
the category is named: Sunny Photos
and an attachment might be named: Sunny Photos Photo Number 1.
So I am trying to check a substring against the category title and if that works then show the attachment properties (title link etc)
My current code is :