Adding to one view a variable filter (a result from another view )

awm's picture

Here is what I need to do:
1.Check the Creation DATE of the most recent node (article)
2. Create a view that lists all the nodes such that node.created = Creation DATE.

In other words, I want to be able to pass a variable date to the filtering criteria. I know I could construct it from scratch using 2 db_query calls but I am looking for a more intuitive way that does not require a lot of customization.
I have been trying to use hook_view_query_alter and add_where() but with not much success because I do not want to create a module just to do this.

Also, can I and/or is it wise to alter the view in the tpl.php template files.

Thanks in advance,

Ali

Comments

Can Tokens work for you here?

databoy's picture

This sounds like an interesting question.

I don't know about the wisdom of putting "business" logic in template files -- it's hard to maintain, and unless the logic is a "display" conditional or query, it seems best to put the code in a module. I would try to create this in Views, and then use Bulk Export from Ctools to create a module.

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week