2

I created a custom item resolver to remove/omit bucket folder item name from url. With this resolver we can access url from:

  • www.xpto.com/folder/2018/08/06/15/40/page
  • www.xpto.com/folder/page

And it works properly.

But when I create a link in a rich text for this bucketed page, the bucket path is not omited.

I followed this blog post: https://sitecorejunkie.com/2016/05/31/omit-sitecore-bucket-folder-item-names-from-page-item-urls/

Seems exactly what I need but it's not working for me.

I'm using Sitecore 9 (and SXA).

6

The use of SXA is rather important in this case.

As you can see in your configuration, SXA uses by default the switchableLinkProvider. This will check your site configuration in Sitecore to determine if you defined a linkprovider there. If not (I assume you did not), it will take the fallback, which is defined here:

<setting name="XA.Foundation.Multisite.FallbackLinkProvider" value="localizedProvider" patch:source="Sitecore.XA.Foundation.Multisite.config"/>

As you can see, the default fallback is the localizedProvider and not "sitecore". So you are actually patching the wrong provider.

To fix this, you could patch the localizedProvider, but I wouldn't do that. I'd rather add a new provider to the list and attach that to your site in SXA. How to do this can be found here: https://doc.sitecore.net/sitecore_experience_accelerator/setting_up_and_configuring/configuring/add_and_select_a_custom_link_provider : navigate to sitecore/content/tenant/site/settings/Site Grouping/site and in the Basic section, in the Link Provider name field, enter the name of your custom provider.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.