By satvision83 on
I've seen some news websites that in every news page/node has a page views counter.
For an example a small icon and next to that icon the number of page views. When I refresh that page I can see that counter increases by one immediately, so that's page hits. How can I do this with Drupal website?
Is it possible to display counter page hits as a field with Views?
Comments
I found a way how to do
I found a way how to do this.
First the core module statistics module has to be activated and marked views count, and then with Views/ field Views counter will be visible.
On the full content, without using views the counter appears in the footer area of the node, as I can see that with firebug. I'm searching a way to create a field with counter, so that will be able to move on the top position next to the title.
=-=
you cannot turn it in to a field. What you may want to investigate is how to print the data manually in the tpl.php file.
Yes, thank you for the
Yes, thank you for the tip.
I've changed the place for
print render($content['links']);(node.tpl.php) to inside the content, not the footer and now the views counter is over the content.That's what I wanted.
=-=
the reads data is printed through links, however so is the add comment link and others. If you are fine with all output being above the content you are fine. If not, I suggest inspecting the $content variable further (using devel if necessary) and investigating the printing of reads manually.
No, I've changed the place
No, I've changed the place only for
print render($content['links']);and change it a bit. All other input are fine, the comments too. Here what did I change:Previous:
After:
You can turn a view into a
You can turn a view into a field using a module like eva or Display Suite