Issue
- Liferay DXP HTML source will contain the below snippet on all portal pages:
<nav class="quick-access-nav" id="vseg_quickAccessNav">
This might be at times detrimental to SEO.
<h1 class="hide-accessible">Navigation</h1>
<ul>
<li>
<a href="#main-content">Skip to Content</a>
</li>
</ul>
</nav>
Environment
- Liferay DXP 7.0
- Liferay DXP 7.1
- Liferay DXP 7.2
- Liferay DXP 7.3
- Liferay DXP 7.4
Resolution
- The current behavior might only be changed in Liferay future versions, in form of a new feature: LPS-97102
- In case you still wish to modify the current DXP behavior, you shall override the file https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/taglib/ui/quick_access/page.jsp:
<h1 class="hide-accessible"><liferay-ui:message key="navigation" /></h1>
with one of the below methods:
- 7.0: Core JSP Override or JSP Overrides Using Custom JSP Bag
- 7.1 or higher: JSP Overrides Using Custom JSP Bag
The attached module (src and .jar) was created by following the above tutorial (7.1) and, once deployed, will modify the <h1>
tag to be a <span>
.
Additional Information
- Official Liferay Feature request: LPS-97102 (this article will be applicable until this feature is implemented)
- Modifying the aforementioned tag may hinder the Liferay's accessibility. You may read more information about the feature here: New feature for Liferay 7: Quick Access
- Overriding core JSPs is deprecated and shall be used only as a last resource. To get more information, see the foreword written in each tutorial
- The attached proof of concept plugin is not an official Liferay solution, it is unsupported and only provided for convenience, to explain the process with a tangible project and be a hint to start your development
Subscriber Exclusive Content
A Liferay Enterprise Subscription provides access to over 1,500 articles that include best practices, troubleshooting, and other valuable solutions. Sign in for full access.
Sign In