Interface SeoTags
It can be adapted from any Page's content that is of sling:resourceType
wcm/foundation/components/basicpage/v1/basicpage.
Usage:
page.getContentResource().adaptTo(SeoTags.class)-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns aMapof alternate language urls of the current Resource.@Nullable StringReturns the canonical url of the current Resource.Returns aListof robots tags to be provided to search engine crawlers.booleanReturns true when the current Resource belongs to a canonical page.
-
Field Details
-
PN_ROBOTS_TAGS
The property name of the robots tags property.- See Also:
-
PN_CANONICAL_URL
The property name of the custom canonical url property.- See Also:
-
-
Method Details
-
isCanonical
boolean isCanonical()Returns true when the current Resource belongs to a canonical page. This is the case when the page's canonical url points to itself, meaning when no custom canonical url is set.The default implementation returns true reflecting the assumption that, if not otherwise specified, each page is canonical.
- Returns:
- true when the current resource has no custom canonical url set
-
getCanonicalUrl
Returns the canonical url of the current Resource.This uses the
SitemapLinkExternalizerimplementation to ensure the same canonical url as it is used in Sitemap(s) is returned. The format of the url is complete, meaning it contains authority, path and extension.This may return
nullwhen the externalization fails.- Returns:
- The canonical, absolute url of the current page.
-
getAlternateLanguages
Returns aMapof alternate language urls of the current Resource.An alternate language link exists for each language copy of the
Page, when thePageis included in a Sitemap. It uses theSitemapLinkExternalizerto ensure the same canonical urls as in Sitemap(s) are returned. The format of the url is complete, meaning it contains authority, path and extension.- Returns:
- The canonical, absolute urls of all alternate language versions of the current page.
-
getRobotsTags
Returns aListof robots tags to be provided to search engine crawlers.The collection is curated and may only return tags that are allowed to appear together.
- Returns:
- the curated
Listof robots tags
-