By ubersoft on
I'm trying to create a view that will display all of the nodes created on the "most recent day of publication."
For example, let's assume that this Friday I publish three nodes, and don't update again until Monday, at which time I publish two nodes.
What I want is for this view to display the three nodes I created on Friday, Saturday and Sunday, and then on Monday replace that with the two nodes I publish, and then continue to display them until the next time the site updates.
I *think* it's possible to do this with the view filters, but I'm not entirely sure how. Does anyone have any ideas?
Comments
Recent Day
I'm interested in doing the same thing, and then possibly, using the Weight module, ordering by what I think is most important for "today" or whatever day it was that I last posted something. I thought maybe the Date Views plugin module might be able to do something like the first part.
Here's a PHP page snippet I whipped up, but ideally I'd like it to be a view so that you can throw other filters in there, like node type, etc.
(Username formerly my full name, Richard Eriksson.)
Views Date Range
I just requested this feature added to the Views Date Range Filter module, which lets you do 'today', but not (yet) the last published date.
(Username formerly my full name, Richard Eriksson.)
I got a partially working "most recent day's publication" script
My problem is almost exactly as you described it in the original post, ubersoft.
I've got a custom content-type that I called in_brief, which is usually just a short snippet with an occasional longer article. I usually publish them on weekdays, and never on weekends. In order to plan for potential future changes, I wanted the custom code to work with an arbitrary number of published in_brief nodes per day, instead of the usual 3 per weekday.
So here's the code I wrote today:
The code works as expected (!), except that I'm putting this directly into a custom block. I think this means I don't have the same easy access to node data/attributes that I would if I were to create/use the file node-in_brief.tpl.php. However, I don't think I want to implement this script in the .tpl.php file, because that would create universal changes to all in_brief nodes, which isn't what I want. I just want a block with the most recent day's in_brief nodes. I want output that contains all of the elements of a standard node: i.e. linked title (which I have), body content (which I have), taxonomy tags (don't have), "submitted" information (don't have), a "read more" link (don't have), etc.
Could I be approaching this the wrong way? Can Drupal perhaps do the query and JOIN for me? I realize I could simply include all the needed data into the db_query, but I keep wondering if there's a simpler way to do it. . . .
Anyone have any ideas on how I can get the full-fleged $node data/attributes while retaining the idea behind the query (to select the most recent day's published content-type). Let me know if anything's unclear; this is my very first venture into practical php scripting, so I wouldn't be surprised if I'm trying to reinvent the wheel.