Unlike the tag could widget which creates links based on a single tag, I'm trying to return entries based on all/each tags of a post.
If I use a function like this, I only get entries that match the entire tag string.
function GetTags(){
return DataObject::get('BlogEntry',"Tags = '$this->Tags'",'','','');
}
What I want to return is all entries that share each of {$this->Tags}.
So if my entry is tagged (Chicken, BBQ, Summer) I want to return not just entries tagged 'Chicken, BBQ, Summer', but all entries tagged with Chicken and/or BBQ and/or Summer.
I assume my syntax Tags = {$this->Tags} is the issue. I probably need to bust apart $this->Tags into individual tags and return those, but I do not know the SQL syntax to say 'where one tag is x and one tag is y and one tag is z...'
Any guidance is greatly appreciated.
Thanks
Chris