By nobodyatall on
is this at all possible with views? i've noticed there's a node: creation time option in the views filters, but it doesn't seem to support php or any way to build a dynamic date.
is this at all possible with views? i've noticed there's a node: creation time option in the views filters, but it doesn't seem to support php or any way to build a dynamic date.
Comments
here you go
The "Node: Created Time" filter has this help text:
So, basically, choose the "Node: Created Time" filter, choose "Is Greater Than" for the Operator, go with "now" in the Value field, and put "-86400" in the Option field. That should show all posts from the last 24 hours (which isn't the same thing as "today", but as close as you can get with views, AFAIK).
--
John Forsythe
Need reliable Drupal hosting?
Exactly what I did :-) Works
Exactly what I did :-) Works like a charm.
Hmm...
:) You can build this functionality using Views arguments, thusly:
Create a View, enable page view, select your type/fields as you want. Make sure it has a non-conflicting URL, and note my point about the url construct in the code below. Then in the arguments section, add an argument of "Node: ID" with "display all values" as the default (if no arg is passed, views will assume a list of all nodes that satisfy your remaining views criteria), and in the argument code, paste the following:
And voila! Hopefully... So when you visit the url "timed", you should get a list of all nodes that satisfy your view criteria, and when you visit "timed/today" you will get a list of nodes published (assuming you have that filter) so far today.
It's fairly trivial to add further code to this so you can have other keywords programmed, but there are obviously ways to do date processing in Views anyway, so this and others that cannot be accomplished with Views "au naturel" are niche use cases, really.
Hope this helps - it was a useful exercise for me in views arguments, at least! :)
Nik
Kineta Systems - Web Development in Nottingham
Hi Nick, will your solution
Hi Nick,
will your solution have anything to do with the event module issue opened here (Ability to have todays events on the front page?).
Spanish Drupal - www.4tres.com : Desarrollo de sitios, páginas web y aplicaciones para Internet eficaces y especializadas en Sevilla.
...
I'd be surprised if this worked. I think you need to replace that with
$args[0] = join('+', $nodes);The 'Node: Id' argument gets a string of NIDs separated by either '+' or ',' (just like a taxonomy selector).Ah,
I didn't know that! I should have added that I didn't test that extensively, it was just coded ad hoc for someone to help them out.
Kineta Systems - Web Development in Nottingham
With views...
Would it also be possible to display whether a node was updated/commented on at the top of a list on the frontpage?
On my site, from the front page you can access a list of all the nodes posted in a time sequential order (nodes are automatically promoted to the front page). I was wondering if, through the views module, or any other means, it would be possible to make a node 'seem new' when it is updated or commented on, so when it is updated or commented on it will go to the top of the list on the front page, thus making the list on the front page a list of all of the recent activity on my site, instead of a time sequenced list of node history. (when a node is update it is buried far back and thus not easily recognized, same with posted on)
Is there another module that could do this, workflow_ng could but I don't know how to make it so things are not stickied on the front page when they are updated or commented on. If anyone could help, I would really appreciate it.
Thanks
You can do this by creating
You can do this by creating a view that has these options:
Basic Information:
name = your_name
Page:
check the provide page checkbox
set the url: ex mypage
set view type to teaser list
Filters:
Node Published = Yes
Sort Criteria:
Node: Updated Time = DESC or ASC depending on your preference.
When your done navigate to the equivalent of http://localhost/mypage in your environment
Quick edit ... there is also a Comment Last Comment Date available in views
Thanks
So if I add three values in my sort criteria (node: updated time, comment: last comment date; node: created time), what is going to happen?
I think I may have tried this before and it wasn't what I expected. I'll try it out but I'm not sure this solves the problem.
Update: It doesn't work.
What the sort criteria does is first list all of my updated pages, then lists all of my nodes with comments, then lists the newly created nodes.
I am trying to keep my front page list in an order that will list the time ordered activity on my site, so when anything happens (a node is created, a node is updated, a node is commented on), the list from the front page will keep an order of all of the activity on the site, with the most recent at the top of the list. (I am using a page view- I am trying to display only a list of ten on the first page and then all the older nodes on the subsequent pages, still all of them on the 'frontpage')
Off topic
I think you should post a new topic for this, it's not really related to the subject of the initial post.
Kineta Systems - Web Development in Nottingham