Skip to content

Instantly share code, notes, and snippets.

@brandonkelly
Last active December 27, 2015 00:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonkelly/7240636 to your computer and use it in GitHub Desktop.
Save brandonkelly/7240636 to your computer and use it in GitHub Desktop.
New 'relatedTo' element param coming in Craft 1.3
<h3>My favorite cocktails that have gin</h3>
{% set cocktails = craft.entries.section('cocktails').relatedTo('and', {
sourceElement: currentUser,
field: 'favoriteCocktails'
}, {
targetElement: craft.entries.section('ingredients').slug('gin'),
field: 'ingredients'
}) %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment