Advertisement
Guest User

Untitled

a guest
Nov 11th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  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 #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement