How can I enable the view count increments for web contents in Asset Publisher Portlet - DXP 7.1 - 7.3
How To articles are not official guidelines or officially supported
documentation. They are community-contributed content and may not always
reflect the latest updates to Liferay DXP. We welcome your feedback to
improve How to articles!
While we make every effort to ensure this Knowledge Base is accurate,it
may not always reflect the most recent updates or official guidelines.We
appreciate your understanding and encourage you to reach out with any
feedback or concerns.
Issue
- When I add the view count in Asset Publisher to the available box, and refresh the page. The view count is not incremented and displays a value of "0"
- Reproduction Steps:
- Set up DXP and start it.
- Go to Content & Data --> Web Content and add basic web content.
- Go to Site Builder --> Pages and create a widget page and add to it an Asset Publisher Portlet by clicking on "+" on the upper right of the page.
- Click on the 3 dot menu of the Asset Publisher and select "Configuration" then Setup --> Display Settings --> Metadata and add "View Count" to the available box and save it.
- Refresh the page or click on the web content link on the Asset Publisher.
- Actual Result: The view count displays "0". It is not incremented.
- Expected Result: The view count should display the number of views as we view the web content.
Environment
- Liferay DXP 7.1
- Liferay DXP 7.2
- Liferay DXP 7.3
Resolution
- In order to activate the view count increments on Asset Publisher Portlet, we should perform the following:
- In Asset Publisher configuration we need to enable the view count increment by selecting the Asset Publisher Configuration --> Setup --> Display Settings --> SET AND ENABLE --> and check the box for "View Count Increment".
- At the METADATA section we add view increment to the current metadata field.
Now if we click on the content title's link and go back the view count increment will display the view counts.
Note: At the Asset Publisher Configuration --> Display Settings --> if we set the Display Template to "Full Content", the view count will display the view counts as we refresh the page.
Did this article resolve your issue ?