简体   繁体   English

drupal:添加内容时,内容不显示“ NEW”

[英]drupal: doesn't show “NEW” to the content when I add one

I am trying to display "NEW!" 我正在尝试显示“ NEW!”。 to the contents added recently in drupal 7. 到最近在drupal 7中添加的内容。
I surfed the internet but couldn't find much about it. 我上网冲浪,但是找不到很多。
I saw a post somewhere on internet which tells to add "Content: Has new content" field to the view. 我在互联网上某处看到一条帖子,要求在视图中添加“内容:具有新内容”字段。
However, that didn't work as well. 但是,这也不起作用。
What is the drupal way of displaying "NEW!" 显示“ NEW!”的drupal方法是什么? to the recently added contents? 最近添加的内容?
Or do I need to code arount with node_mark() or somehing? 还是我需要使用node_mark()或其他代码编写代码?
Cheers 干杯

A related question was answered in drupal.stackexchange.com A paraphrase of the answer reads drupal.stackexchange.com中回答了一个相关的问题。

"There is a database table called history that records a users history to check against. There is an option in Views to add a 'new' marker to content that has not been viewed by the user and had been created within a certain time frame. “有一个称为历史的数据库表,记录了要检查的用户历史记录。“视图”中有一个选项可以向用户未查看并在特定时间范围内创建的内容添加“新”标记。

If you are further interested in how the 'new' marker works, you can find the query that Views uses in views/modules/comment/views_handler_field_node_new_comments.inc to add the 'new' tag to a list of fields." 如果您对“新”标记的工作方式进一步感兴趣,可以在Views / modules / comment / views_handler_field_node_new_comments.inc中找到View使用的查询,以将“ new”标记添加到字段列表中。”

The long and short of it is that Views will do the trick for you very easily. 总而言之,Views可以很轻松地为您解决问题。 Hoping that gives some help. 希望能提供一些帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM