can i add "NEW" icon in VIEWS ? i just wanna add "NEW" in RED near the new nodes some thing like (Node: Has new content) but stay appear for a 1 or 2 weeks for all users
is there is any module can do that ?
anyone can help me in this ?

Comments

merlinofchaos’s picture

Category: feature » support
Status: Active » Fixed

Well you could probably add the 'post date' field and theme the field to provide an icon if it is within a certain timeframe. There's nothing that will do this automatically, though, so you'll have to use a bit of PHP to accomplish it. This is the best I can offer.

qaffaf’s picture

thnx merlinofchaos but how i can do that by coding ? can u help me to do it ?

qaffaf’s picture

Status: Fixed » Active
dawehner’s picture

here is a example how the tracker module does it

<?php
      l($node->title, "node/$node->nid") .' '. theme('mark', node_mark($node->nid, $node->changed)),
?>

I Think this will help you

qaffaf’s picture

thnx alot dereine but i'm new in drupal and php... can u help me where i can put this code and what to do pleaseeee ?

dawehner’s picture

Priority: Critical » Normal

this is not critical ... :)

add a field node: post date;

Then click theme informations and add a specific theme for the node: post date field.

Then edit this theme file and add

<?php

      l($node->title, "node/$node->nid") .' '. theme('mark', node_mark($node->nid, $node->changed));
?>

This will not be all, because i'm not sure how to access the other stuff like nid title and changed, i have to see how to do it

perhaps you can figure this out of the variable $row in the theme file

qaffaf’s picture

it gives me some hyroglifics symbols :P
what i can do now ?
thnx for helping me

CrashNet’s picture

Subscribing...would be a nice little feature to have. Surprised its not built into core as news sites, etc do this all the time.

merlinofchaos’s picture

Oh, you might also be able to override theme_node_mark which is what most things in Drupal use to display if a node (or comment) is new. Hm. Maybe it's theme_mark I forget.

mcrittenden’s picture

Title: can i add "NEW" icon in VIEWS » Adding "NEW" icon to Views

qaffaf: Try reading http://www.group42.ca/theming_views_2_the_basics for a background of Views theming (or just Google "theming views") and then the code posted here will make a lot more sense.

esmerel’s picture

Status: Active » Closed (fixed)

Suggestions given.

tarang127’s picture

How do I add this new field "post-date"?