Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Marek 16 posts 78 karma points
    Sep 25, 2017 @ 09:03
    Marek
    0

    Changing diacritic marks to latin in product slug

    Hi

    I try to change polish diacritic marks like: ą, ę, ś (https://pl.wikipedia.org/wiki/Znaki_diakrytyczne) to latin a,e,s in slug

    now diacritic marks are removed

    but i coudn't do it from code

    it doesn't work during creating product form code:

    // creating slug with changed diacritic marks

    var slugUrl = NormalizeStringForUrl(Product.Name);

    // set slug

    var detachedContent = new ProductVariantDetachedContent( Product.ProductVariantKey, detachedContentType, "pl-PL", ddvc) { CanBeRendered = true, Slug = slugUrl };

    // save

    Product.DetachedContents.Add(detachedContent); productService.Save(Product, true);

    but it doesn't work

    so, I've created pull request https://github.com/Merchello/Merchello/pull/2020/commits/8b9f8a3a23e6d445f46330d7ab1bd3d7a78e3d41

    which change chars by getting them from umbracoSettings.config in urlReplacing section

    have you any other suggestions?

Please Sign in or register to post replies

Write your reply to:

Draft