0

I want to display a block on the node page if it is being viewed for the first time. After that that block will not be displaying.

It will be for all the nodes of a given content type.

I know the Drupal put the node in the cache if it is being viewed for the first time but I can't found its code.

Is it possible? Any Ideas?

3
  • Viewed by some specific user or all user ?
    – Rupesh
    Commented Apr 29, 2014 at 6:46
  • all users and the block will be a custom block.
    – Ahmad
    Commented Apr 29, 2014 at 6:54
  • update question with more details clearly
    – Rupesh
    Commented Apr 29, 2014 at 7:01

2 Answers 2

2

Used the core statistics module.

and then on node view used the function statistics_get() function and then check it the total count is less than 1.

1
  • Great! it's so useful Commented Apr 29, 2014 at 7:22
0

Use Views Blocks and filter it with Content: Has new content to know if it is being viewed for the first time.

1
  • if also contains if a node is being updated. and also I have to display a custom block.
    – Ahmad
    Commented Apr 29, 2014 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.