I was trying to make it without coding a new module; the steps and the result are:
1. created a join, which is no required I can list all the rooms with the nid of bookings (if avaliable). 2. Created a filter per dates: only rooms with bookings for that night are available 3. Filter for NULL related booking nid No room listed
I think the filter should affect only joined content, but it it is affecting the full content. How can I limit to the join?
2015-01-19 16:07 GMT+01:00 Jamie Holly hovercrafter@earthlink.net:
How are you associating the rooms content type to the reservations one? If you're using entity reference, then you would want to create a relationship with the reservations content type through that reference field. Make sure you don't check "require this relationship" then add a filter so that the related node (reservations) nid is NULL.
The other option is in a custom module, using hook_views_query_alter. Load the reserved room nids, through a normal DB query, then add a NOT IN condition to the list of nids. Here's the documentation on that hook:
https://api.drupal.org/api/views/views.api.php/function/hook_views_query_alt...
Jamie Hollyhttp://hollyit.net
On 1/19/2015 9:37 AM, Lluís Forns wrote:
I have a site with 2 content types: rooms and reservations. I want to list all the rooms without a reservation for an interval, and also for services, capacity, ....
I tried creating a view with a PHP filter to check free rooms, but then if the page lists 10 rooms, sometimes there are 7, 2, or 0; because the filter lists the 10 rooms and after remove the occupied ones.
I have tried to create a "subview" filter to select nodes "not in (view of occupied rooms); but I haven't find a way to do so.
Any idea of how to accomplish this?
thanks
*Ser freak no és imprescindible per ser informàtic, però ajuda.
-- [ Drupal support list | http://lists.drupal.org/ ]