By problue solutions on
I have a view which lists the titles of nodes in a table format, I would like to have a *new* content marker beside nodes which have been posted since the user last viewed the table OR with a post date within say the last 3 days, after the node is more than 3 days old the new marker should disappear from beside the node title in the table view. The built-in new content field is of no use because the user must actually click on the node and view it so that it no longer shows as new content, i need the new content marker to disappear when they have simply viewed the table of node titles.
any ideas?
Comments
bumping this in the hope
bumping this in the hope someone will know how to do this or know of a module that might help
Problue Solutions
Lsat 3 Days
For my own skill set, the easiest solution for this would be to approach it with the "OR with a post date within say the last 3 days" objective. In your node.tpl.php file, you can create some sort of comparison between the times, something like this:
You'll obviously need to fine-tune to your needs, but hopefully this will either get you going or someone else will improve the above.
The other solution, where the marker disappears once a user sees it, would entail somehow storing what user has seen the node-table (either a cookie, or in the database). Interesting question.
Thanks. If i want this for
Thanks.
If i want this for only one specific content type how would i amend the code?
Does it matter where i insert this in node.tpl.php?
Problue Solutions
Nodes
To limit this to a content type (page, story, etc.), you can do a conditional:
As far as where you put your code, it depends on where you want the output on your page. The variables are already set, so I guess it could go about anywhere. You could also create a function to handle this and put it in your site's template.php file.
As a tip:
To see a list of all the node's parameters, just put this at the type of your node.tpl.php file (but not on a live site!):
Sorry to respond to this
Sorry to respond to this after so long, but from is being said above is that not only going to work for the new content marker displayed within the actual node? I'm using it in a VIEW as described in the first post, so the output where its displayed will not be in node.tpl.php surely?
Is there any way to use similar code to above but for a VIEW and not node?
Problue Solutions
"Node: Has new content" field
Views has a Field option for "Node: Has new content". I'm not sure what it defines as "new content" but it's worth trying.
Thanks for the reply, but as
Thanks for the reply, but as i mentioned in the first post the Node:has new content marker will always display "new" unless the user actually views the full node, I need the new marker to disappear after they have simply viewed the table of node titles, or alternatively the new marker dissapears after a set time (like 3 days)
This is so important to my paticular setup that I think it could increase the usefullness of my site immensley, so if anyone can even point me in the right direction I'd be really grateful!
Problue Solutions