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')) %}

{% trans %}Goal{% endtrans %}

{% 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 %}

{% trans %}What are the options for displaying popularity tracking?{% endtrans %}

{% trans %}You can display a content hits counter of how many times a content item has been viewed, at the bottom of content item pages. You can also place a Popular content block in a region of your theme, which shows a list of the most popular and most recently-viewed content.{% endtrans %}

{% trans %}Steps{% endtrans %}

  1. {% trans %}In the Manage administrative menu, navigate to Configuration > System > {{ statistics_settings_link }}.{% endtrans %}
  2. {% trans %}Check Count content views and click Save configuration.{% endtrans %}
  3. {% trans %}In the Manage administrative menu, navigate to People > {{ permissions_link }}.{% endtrans %}
  4. {% trans %}In the Statistics section, check or uncheck the View content hits permission for each role. Click Save permissions.{% endtrans %}
  5. {% trans %}Optionally, in the Manage administrative menu, navigate to Structure > Block layout. Place the Popular content 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 %}

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.