statistics.tracking_popular_content.html.twig

Same filename in other branches
  1. 9 core/modules/help_topics/help_topics/statistics.tracking_popular_content.html.twig
  2. 10 core/modules/statistics/help_topics/statistics.tracking_popular_content.html.twig
---
label: 'Tracking and displaying popular content'
related:
  - core.tracking_content
  - history.tracking_user_content
  - block.place
---
{% set statistics_settings_link_text %}{% trans %}Statistics{% endtrans %}{% endset %}
{% set permissions_link_text %}{% trans %}Permissions{% endtrans %}{% endset %}
{% set statistics_settings_link = render_var(help_route_link(statistics_settings_link_text, 'statistics.settings')) %}
{% set permissions_link = render_var(help_route_link(permissions_link_text, 'user.admin_permissions')) %}
<h2>{% trans %}Goal{% endtrans %}</h2>
<p>{% trans %}Configure and display tracking of how many times content has been viewed on your site, assuming that the core Statistics module is currently installed.{% endtrans %}</p>
<h2>{% trans %}What are the options for displaying popularity tracking?{% endtrans %}</h2>
<p>{% trans %}You can display a <em>content hits</em> counter of how many times a content item has been viewed, at the bottom of content item pages. You can also place a <em>Popular content</em> block in a region of your theme, which shows a list of the most popular and most recently-viewed content.{% endtrans %}</p>
<h2>{% trans %}Steps{% endtrans %}</h2>
<ol>
  <li>{% trans %}In the <em>Manage</em> administrative menu, navigate to <em>Configuration</em> &gt; <em>System</em> &gt; <em>{{ statistics_settings_link }}</em>.{% endtrans %}</li>
  <li>{% trans %}Check <em>Count content views</em> and click <em>Save configuration</em>.{% endtrans %}</li>
  <li>{% trans %}In the <em>Manage</em> administrative menu, navigate to <em>People</em> &gt; <em>{{ permissions_link }}</em>.{% endtrans %}</li>
  <li>{% trans %}In the <em>Statistics</em> section, check or uncheck the <em>View content hits</em> permission for each role. Click <em>Save permissions</em>.{% endtrans %}</li>
  <li>{% trans %}Optionally, in the <em>Manage</em> administrative menu, navigate to <em>Structure</em> &gt; <em>Block layout</em>. Place the <em>Popular content</em> block in a region in your theme (you will need to have the core Block module installed; see related topic for more details on block placement).{% endtrans %}</li>
</ol>

File

core/modules/statistics/help_topics/statistics.tracking_popular_content.html.twig

View source
  1. ---
  2. label: 'Tracking and displaying popular content'
  3. related:
  4. - core.tracking_content
  5. - history.tracking_user_content
  6. - block.place
  7. ---
  8. {% set statistics_settings_link_text %}{% trans %}Statistics{% endtrans %}{% endset %}
  9. {% set permissions_link_text %}{% trans %}Permissions{% endtrans %}{% endset %}
  10. {% set statistics_settings_link = render_var(help_route_link(statistics_settings_link_text, 'statistics.settings')) %}
  11. {% set permissions_link = render_var(help_route_link(permissions_link_text, 'user.admin_permissions')) %}
  12. <h2>{% trans %}Goal{% endtrans %}</h2>
  13. <p>{% trans %}Configure and display tracking of how many times content has been viewed on your site, assuming that the core Statistics module is currently installed.{% endtrans %}</p>
  14. <h2>{% trans %}What are the options for displaying popularity tracking?{% endtrans %}</h2>
  15. <p>{% trans %}You can display a <em>content hits</em> counter of how many times a content item has been viewed, at the bottom of content item pages. You can also place a <em>Popular content</em> block in a region of your theme, which shows a list of the most popular and most recently-viewed content.{% endtrans %}</p>
  16. <h2>{% trans %}Steps{% endtrans %}</h2>
  17. <ol>
  18. <li>{% trans %}In the <em>Manage</em> administrative menu, navigate to <em>Configuration</em> &gt; <em>System</em> &gt; <em>{{ statistics_settings_link }}</em>.{% endtrans %}</li>
  19. <li>{% trans %}Check <em>Count content views</em> and click <em>Save configuration</em>.{% endtrans %}</li>
  20. <li>{% trans %}In the <em>Manage</em> administrative menu, navigate to <em>People</em> &gt; <em>{{ permissions_link }}</em>.{% endtrans %}</li>
  21. <li>{% trans %}In the <em>Statistics</em> section, check or uncheck the <em>View content hits</em> permission for each role. Click <em>Save permissions</em>.{% endtrans %}</li>
  22. <li>{% trans %}Optionally, in the <em>Manage</em> administrative menu, navigate to <em>Structure</em> &gt; <em>Block layout</em>. Place the <em>Popular content</em> block in a region in your theme (you will need to have the core Block module installed; see related topic for more details on block placement).{% endtrans %}</li>
  23. </ol>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.