The XML Sitemap does not include Web Content URLs from the Asset Library or the Global Site
Written By
Daniel Carrillo Broeder
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 sitemap does not include any web content created in Asset Libraries or the Global site.
- Web contents having a Display Page template within the site are correctly included in the XML sitemap.
Environment
- Liferay DXP 7.3, 7.4
- Quarterly Releases
Resolution
- This behavior is not currently implemented and considered as a pending Feature Request: LPD-21639 - Add Global / Asset Libraries web content URLs in sitemap.xml is active
- Workarounds include extending Liferay's sitemap.xml by intercepting the request and generating a custom sitemap with the repository content URLs.
- Alternatively, you can implement a custom extension that overrides the JournalArticleSitemapURLProvider class (or any other kind of extension):
import com.liferay.site.provider.SitemapURLProvider;
@Component(immediate = true,
service = SitemapURLProvider.class,
property = {"service.ranking:Integer=100"})
public class SitemapTest implements SitemapURLProvider {
...
@Override
public void visitLayout(
Element element, String layoutUuid, LayoutSet layoutSet,
ThemeDisplay themeDisplay)
throws PortalException {
_journalArticleSitemapURLProvider.visitLayout(element, layoutUuid, layoutSet, themeDisplay);
// Add custom logic for repository content URLs associated with the display page.
}
...
@Reference(target = "(component.name=com.liferay.journal.internal.provider.JournalArticleSitemapURLProvider)")
private SitemapURLProvider _journalArticleSitemapURLProvider;
}
Did this article resolve your issue ?