Filtering entries by multiple categories with multiple filters I'm trying to build a category filter on a page that lists houses that are for sale. The idea of the filter is to make it possible to select houses which, for example, are for sale or rent, have a certain amount of rooms, a minimum/maximum price and eventually a search option to search at location, postal code or street address. 

I first built one filter, which filters if a house is for sale or for rent. This filter works with two anchor buttons in a list. I now want to add the next filter, which is the amount of rooms. This filter should be a dropdown (a select tag with options in it).

I got both filters to work, but I want them to stack upon each other. So when the houses that are for sale are being shown and the user clicks on houses with 4+ rooms, it shows the houses that are for sale AND have 4+ rooms. 

What I came up with so far

The filter for sale/rent houses

&lt;ul class="button-group round"&gt;
 {% for offerCategory in craft.categories.group('offerTypes').find() %}
  &lt;li&gt;
   &lt;a class="mart-button" href="{{craft.request.url}}/?category={{ offerCategory.slug }}"&gt;{{ offerCategory.title }}&lt;/a&gt;
  &lt;/li&gt;
 {% endfor %}
&lt;/ul&gt;


The filter for the amount of rooms

&lt;select onChange="window.location.href=this.value"&gt;
 {% for offerRooms in craft.categories.group('offerRoomTypes').find() %}
  &lt;option value="{{craft.request.url}}/?category={{ offerRooms.slug }}" name&gt;{{ offerRooms.title }}&lt;/option&gt;
 {% endfor %}
&lt;/select&gt;


And the rest

{% if craft.request.getParam('category') is not null %}

 {% set offerCategory = craft.categories.slug(craft.request.getParam('category')) %}
 {% set offerRooms = craft.categories.slug(craft.request.getParam('category')) %}

 {% set offers = craft.entries({
    section: 'offers',
    relatedTo: [
        'and',
        { targetElement: offerCategory },
        { targetElement: offerRooms }
    ]
 }) %}

{% else %}

 {% set offers = craft.entries.section('offers').find() %}

{% endif %}


The URL that's being fetched is now: .../?category=forsale and when selecting rooms .../?category=4rooms. What I want to achieve is something like .../?category=forsale,4rooms (I'm nog sure if that's the right way). 
If someone also can tell me directly how the search should be implemented that's welcome as well ;). Thanks in advance!
Passing the category as a comma delineated string and using craft.request.getParam('category') the second time will not grab the second variable 4rooms.  First you need to parse that string into an array. This will create an array ['forsale','4rooms']. Use the parts of that array to assign to your other variables.

{% set params = craft.request.getParam('category')|split(',') %}
{% set offerCategory = craft.categories.slug(params[0]) %}
{% set offerRooms = craft.categories.slug(params[1]) %}