0

This view is the result of a given postcode. how could I hide/filter referenced content when its end date is over? The referenced content should disappear but the non referenced content should still be displayed.

enter image description here

0

I'm not so sure this is possible through the views interface. But, you can easily do this through your theme layer.

In your view admin area, under advanced there's the page: Theming information. Clicking on that will give you a list of available tpl.php names that can be used to create your own tpl.php files that can be added to your theme. Your probably gonna wanna use a row style output. The list of those files go from general to specific, so the last time will only be applied to your view. Clicking on the link of row style will give you the content of the default file.

All you would need to do is just print the fields as normal, with the exception of the fields you want to exclude. Just use a standard if to check to make sure they're still valid, if not, don't print them.

  • Thanks for the answer. It's not about the layout, it's about the functionality. I'm not sure if I understand what you're saying. – Auguste Van Nieuwenhuyzen Sep 27 '14 at 9:26
  • Did it with custom JS – Auguste Van Nieuwenhuyzen Mar 20 '15 at 15:16
0

My suggestion would be that you display your Starts/Ends timer in another view as an attachment (or you could bring it in using views field view module).

Create this second view as your timer interface, but set your Filter Criteria to only show results when Current Time > Start Time AND Current Time < End Time

I've done something similar where I only wanted to show something based on a property within the view

Only show Events based on Abstract Dates

In my example above, the first date/time is set to greater than or equal to now, the second is set to less than or equal to now. In the setup, you set the relative date as 'now' and it will work on what time the page has loaded

Time setup

Then you can pull this second view in as mentioned above, but it should mean that this second view will return no results outside of the times you specify. However, unless you have an AJAX method that will refresh the table when the timer reaches 0, it will show a result based on when they first load the page

  • thanks for the answer and the visual aid. I did as you suggested with the views embed module. It looks good but it shows all the second view 's content, it's not related to the 'shop' anymore. Also the filters dont work ( I have a referenced start date equals today & end date equals to or greater than now. If I use greater than, everything disappears, this shouldn't be the case. ) I need help this is way too complicated for me. thanks guys – Auguste Van Nieuwenhuyzen Sep 26 '14 at 20:40
  • I don't think it's possible to do that and still keep the relationship – Auguste Van Nieuwenhuyzen Sep 27 '14 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.