Date arguments can default to "the current date", but quite a fre context-sensitive views depend on the creation or update date of the node that's currently being displayed.

The 'User UID' argument's default handler allows it to look for the current node's uid -- this patch allows the Date-based args to pull the created or updated timestamp from a node that's currently on-screen. That makes it easy to build "this day in history" or "other content posted the same week as this node" sidebar blocks using just a single argument.

When used with calendar and date module, it also makes it simple to have a calendar block that "follows" whatever node you're currently examining.

CommentFileSizeAuthor
#4 date-default.patch1.87 KBeaton
date-argument-defaults.patch1.54 KBeaton

Comments

merlinofchaos’s picture

menu_get_object('node') won't always work since things like Views use their own argument handlers, and Panels will probably do the same thing. So we have to watch out for that.

I was always a little uncomfortable with the date-embedded defaults, too, though I guess that concept is basically ok, but there's a giant slippery slope here about wanting to use data from one object to seed another object, and I'm not quite sure the best way to go about doing that. Is this the road we really want to go down from here?

merlinofchaos’s picture

Status: Active » Needs work
eaton’s picture

Status: Needs work » Active

Here's a re-rolled version of the patch that uses the 'smarter' approach used in the node-nid argument default plugin.

I definitely share the concern. There are a lot of ways that these defaults could be handled -- why not date fields on the node, or the user's last login? All could be really useful, I think, but it's easy for it to get out of control. This one "feels" like an easy win and enables a lot of nice stuff (sidebar blocks that show content from the node's week, not the current week, etc) but I don't know how we could safely/reasonably push it much farther than this...

eaton’s picture

Status: Active » Needs review
StatusFileSize
new1.87 KB

Er, HERE is a re-rolled version. Just tested it and whipped up a nice "Twitter messages posted on the same day this node was posted" sidebar block.

merlinofchaos’s picture

Status: Needs review » Fixed

Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.