SHARE
TWEET

Untitled

a guest Nov 11th, 2015 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {% set sectorSlug = craft.request.getSegment(2) %}
  2. {% set socialServiceCategory = craft.categories.group('socialServices').slug(sectorSlug).first() %}
  3. {% set socialServiceCategoryId = socialServiceCategory.id %}
  4.  
  5. {% set technologyCategoryIds = [] %}
  6. {% if craft.request.getParam('type') %}
  7.     {% set technologyCategoryIds = technologyCategoryIds|merge(craft.request.getParam('type')) %}
  8. {% endif %}
  9.  
  10. {% set categoryIds = [socialServiceCategoryId]|merge(technologyCategoryIds) %}
  11.  
  12. {% set entries = craft.entries({
  13.     section: 'solutions',
  14.     relatedTo: {
  15.         targetElement: ['and']|merge(categoryIds)
  16.     }
  17. }).order('listingType desc', 'title asc') %}
  18.  
  19. {# the above does *not* limit entries to socialServiceCategoryId #}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top