Domanda

i have content type in Drupal 6 that has date field, that is date when some historical event happened.

I want to create a view that will show all historical events that happened today.

I created 2 computed fields that will take data from that date field, one for month and other for day. Also i created view and added this two fields as filter. And when i enter exact numbers in filter, like 9 and 20 it shows the articles that happened on this month and day.

But since its not exactly a date field i cant enter relative values like "now" or "today" and someone needs to change this manually every day.

What is best way to get this filter take todays day and month.

È stato utile?

Soluzione

OK i found the solution.

I had to use Arguments ( contextual filters ), and in argument i would use php code as validator and than just get todays day with simple code:

$day = date("j");
return $day;

Hope this helps someone in future.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a drupal.stackexchange
scroll top