Tuesday 7 May 2019

SeoBoost: Internationalization (Absolute Canonical, Alternate Links & Breadcrumbs) for Episerver

The Episerver Html.AlternateLinks() &Html.CanonicalLink()  HTML helpers are very useful for developers to implement Hreflang & Canonical Tags with minimal effort but they always render relative Url(s).

Google support both relative and absolute URLs but absolute URLs are preferred: https://support.google.com/webmasters/answer/139066?hl=en&rd=1

Almost all the projects I worked against had the requirement to render absolute URLs for Hreflang & Canonical Tags. I end up creating my own simple yet powerful open source solution SeoBoost to resolve this missing feature from Episerver Seo HTML helpers.

The SeoBoost's helper methods take account of all the domain settings under Admin >  Config > Manager Website and generate the absolute links accordingly.

Currently, the SeoBoost provides the following functionality to generate
  • Canonical Tag
  • Hreflang Tags (Alternate Links)
  • Breadcrumbs
Usage:

Include the follow @using SeoBoost.Helper at top of the Mater page.

For Canonical Tag
Use the following extension @Html.GetCanonicalLink() within <head></head> section.

For Hreflang Tags (Alternate Links)
Use the following extension @Html.GetAlternateLinks() within <head></head> section.

For Breadcrumbs Items
Use the following extension @Html.GetBreadcrumbItemList() where required.

The latest version of  Seoboost NuGet package is available for Episerver 11+ at  Episerver NuGet Feed

About the Author

Adnan Zameer, Lead Developer at Optimizley UK, is a certified Microsoft professional, specializing in web app architecture. His expertise includes Optimizley CMS and Azure, showcasing proficiency in crafting robust and efficient solutions.

0 comments :

Post a Comment