0

How can I display entries for multiple tags?

For example http://www.my-domain.com/products/by-tag/color/blue+red+white should to display all entries which were tagged with blue and red and white "color tags"

I have try to split last segment by "+" and then loop through that array as separate {exp:tag:entries channel="products" tag="<?php echo $tag; ?>"} but final result is kind of messy, especially when multiple pages were returned.

  • @Solspace So no statement or even solution on that matter? Extension can't handle multiple tags or what (bug)? – JackTheKnife Nov 26 '14 at 21:38
1

You should be able to list entries tagged with your three tags using {exp:tag:entries} and the tag_separator="" parameter. For example:

{exp:tag:entries
  channel="products"
  tag_separator="+"
  marker="color"
}

The default is a comma. If you want tags to be separated by a +, then use tag_separator="+". In some cases, depending on your server and htaccess file settings, the + is actually read as a space, so if the above doesn't work try tag_separator=" ".

The marker="" parameter can be used when having Tag dynamically determine the tags from the URI, which would be detected using another URI marker rather than the standard tag marker segment. As an example using your case, insead of template/tag/my_tag it would be template/color/my_tag. Think of it as the category marker segment in EE for {exp:channel:entries}.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.