Legacy Knowledge Base
Published Jul. 2, 2025

Receiving no 'View Usage' count with embedded web content after deploying a custom theme

Written By

Kanchan Bisht

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.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • The usage count in 'view usages' does not change when the web content is embedded through the theme
Steps to reproduce
  • Create 'Site'
  • Create 'Content Pages'
  • Create 'Web Content'
  • Copy the friendly URL of the above web content
  • Deploy the custom theme.
  • Go to the 'Site Builder' > page configuration > change the current theme and apply custom theme
  • After applying the theme, three below options would receive, replace "Footer-Friendly-Id" with the web content-friendly URL which was copied on step 4.
    'SignIn-Friendly-Id' ,'SignOut-Friendly-Id' & 'Footer-Friendly-Id' (part of custom theme)
  • Go to the site, web content would be visible.
  • Control panel> web content > (created web content)> view usages
  • Zero (0) count is present.
    Expected Behaviour: View usages should display as many pages as created in step#2.
    Observed Behaviour: View usages showing 0 counts.

Environment

  • Liferay 7.2 DXP-5

Resolution

The theme doesn't contain conversion from Long to String in the init_custom.ftl

        <#assign journalArticlePreferencesMap = {
            "portletSetupPortletDecoratorId": "barebone",
            "groupId": getterUtil.getString(group_id?c),
            "articleId": getterUtil.getString(journalArticle.getArticleId())
        } />

Note:  The ?c in the groupId line.

Using this in a clean environment should result in increased view usages count.
To fix this in a previously established environment, need to remove the old portlet preferences. 

'Clean Up Orphaned Theme Portlet Preferences' will clear up most of these (and any other orphaned portlet, be careful), but one row might need manual clear up from the DB. That one should be identifiable with the following query, please fill out <groupId> and <instanceId>

SELECT * FROM portletpreferences WHERE ownerId=<groupId> AND ownerType = 3 AND portletId = "com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_<instanceId>"

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base