0

I have inherited my items from _HasValidUrlName template, that should create valid item name. for example replace spaces to dash. but item display name would be equal to user input.

but at sitecore 9 it is not working by some reason, at sitecore 8 it was ok.

does anyone know why ?

  • Could you provide more information on this? How does the functionality of ensuring the item name is valid work? – Kasaku Nov 25 '19 at 18:28
  • @Kasaku for example when user create item with spaces like "My Page" item name would be my-page, but display name would be "My Page" – Arbejdsglæde Nov 26 '19 at 7:59
  • _HasValidUrlName sounds like a custom template? Can you elaborate how this enforced a valid name in you Sitecore 8 solution? – Bryan Archer Dec 2 '19 at 22:55
  • @BryanArcher It's related to SXA, something ootb using that module – jammykam Dec 2 '19 at 23:00
2

Which version of SXA are you using?

Based on what I have come across, _HasValidUrlName is used in Sitecore.XA.Foundation.ContentValidation to check if the item being created is inherited from _HasValidUrlName template but it doesn't check for what you are looking for atleast in Sitecore SXA 1.8

 public struct _SeoUrlValid
{
  public static ID ID = ID.Parse("{0A7DA0A0-FCD9-4B7B-A725-E159FA3E7E6C}");
}

protected virtual bool ShouldValidate(Item item)
{
  return item.DoesItemInheritFrom(Sitecore.XA.Foundation.ContentValidation.Templates._SeoUrlValid.ID);
}

You can start from there and dig further. Hope it helps!

| improve this answer | |
0

The reason is that this part was move out from SXA configs settings

 <events>
          <event name="item:added">
            <handler patch:after="*[@type='Sitecore.Data.Fields.ItemEventHandler, Sitecore.Kernel']" type="Sitecore.XA.Foundation.ContentValidation.EventHandlers.SeoUrlHelper, Sitecore.XA.Foundation.ContentValidation" method="OnItemAdded"/>
          </event>
          <event name="item:renamed">
            <handler type="Sitecore.XA.Foundation.ContentValidation.EventHandlers.SeoUrlHelper, Sitecore.XA.Foundation.ContentValidation" method="OnItemRenamed"/>
          </event>
          <event name="item:copied">
            <handler patch:after="*[@type='Sitecore.Tasks.ItemEventHandler, Sitecore.Kernel']" type="Sitecore.XA.Foundation.ContentValidation.EventHandlers.SeoUrlHelper, Sitecore.XA.Foundation.ContentValidation" method="OnItemCopied"/>
          </event>
        </events>
| improve this answer | |

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.