Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-28811

As an Administrator I want to decide which pattern should be used in URL generation

    Details

    • Sprint:
      [2.2] Sprint 4
    • Story Points:
      2

      Description

      The customer asked for the way to change how generated URLs looks like.
      The customer expects URLs like: www.example.com/example-article and I think that we should provide some easy way to configure this behavior.

      Currently, out-of-box it is www.example.com/Example-Article. Moreover, you can set-up SlugConverter to use urlalias_compat, but then generated URL will look like: www.example.com/example_article.

      In theory, you can manipulate that configuration by the service definition. You can pass own configuration there:

      services:
          ezpublish.persistence.slug_converter:
              class: "%ezpublish.persistence.slug_converter.class%"
              arguments: ["@ezpublish.api.storage_engine.transformation_processor", "%slug_configuration%"]
      

      parameters:
          slug_configuration:
              transformation: urlalias
              transformationGroups:
                  urlalias:
                      commands:
                          - ascii_lowercase
                          - cyrillic_lowercase
                          - greek_lowercase
                          - latin1_lowercase
                          - latin-exta_lowercase
                          - latin_lowercase
                      cleanupMethod: url_cleanup
              wordSeparatorName: dash
      

      but, thanks to "+" in https://github.com/ezsystems/ezpublish-kernel/blob/6.13/eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/SlugConverter.php#L154 it won't work. Whole configuration array will be immediately overwritten. You will get a lot of exceptions because back-end still uses urlalias_compat which is overwritten using the mentioned configuration.
      Ultimately, you can make it work, but it requires a lot of configuration in parameters, something like:

      parameters:
          slug_configuration:
              transformation: urlalias
              transformationGroups:
                  urlalias:
                      commands:
                          - ascii_lowercase
                          - cyrillic_lowercase
                          - greek_lowercase
                          - latin1_lowercase
                          - latin-exta_lowercase
                          - latin_lowercase
                          - space_normalize
                          - hyphen_normalize
                          - apostrophe_normalize
                          - doublequote_normalize
                          - greek_normalize
                          - endline_search_normalize
                          - tab_search_normalize
                          - specialwords_search_normalize
                          - apostrophe_to_doublequote
                          - math_to_ascii
                          - inverted_to_normal
                          - special_decompose
                          - latin_search_decompose
                          - cyrillic_transliterate_ascii
                          - greek_transliterate_ascii
                          - hebrew_transliterate_ascii
                          - latin1_transliterate_ascii
                          - latin-exta_transliterate_ascii
                          - cyrillic_diacritical
                          - greek_diacritical
                          - latin1_diacritical
                          - latin-exta_diacritical
                      cleanupMethod: url_cleanup
              wordSeparatorName: dash
      

      plus all configuration for urlalias_compat and urlaslias_iri.

        Issue Links

          Activity

          Hide
          Ivo Lukač added a comment -

          IMO we need to make the www.example.com/example-article to be default as this is the SEO best practice for a long time now. Related discussion: https://discuss.ezplatform.com/t/going-underscore-with-nice-urls-by-default-or-not/243

          Show
          Ivo Lukač added a comment - IMO we need to make the www.example.com/example-article to be default as this is the SEO best practice for a long time now. Related discussion: https://discuss.ezplatform.com/t/going-underscore-with-nice-urls-by-default-or-not/243
          Hide
          Pierre-Julien Cazaux added a comment -

          Hello,

          I can see the fix version have been updated from 1.13.0 to 2.1.0. This need to be fixed within the LTS version : 1.13.X

          I reopen the https://support.ez.no/ticket/view/6622 initial ticket for more followup.

          Thx,
          PJ

          Show
          Pierre-Julien Cazaux added a comment - Hello, I can see the fix version have been updated from 1.13.0 to 2.1.0. This need to be fixed within the LTS version : 1.13.X I reopen the https://support.ez.no/ticket/view/6622 initial ticket for more followup. Thx, PJ
          Hide
          Sylvain Guittard added a comment -

          Hi Pierre-Julien Cazaux!
          During the planning, I accidentally removed 1.13 from the Affected versions field (not Fixed versions). I added it again.
          We plan to work on this feature during the next sprint and release it on v2.2.0.

          We'll check after how much work is needed to backport this on 1.13. We also have to be very careful when it comes to add "features" (especially this one) to the LTS. Hope you understand

          Show
          Sylvain Guittard added a comment - Hi Pierre-Julien Cazaux ! During the planning, I accidentally removed 1.13 from the Affected versions field (not Fixed versions ). I added it again. We plan to work on this feature during the next sprint and release it on v2.2.0. We'll check after how much work is needed to backport this on 1.13. We also have to be very careful when it comes to add "features" (especially this one) to the LTS. Hope you understand
          Hide
          Pierre-Julien Cazaux added a comment -

          Hello Sylvain and thank you for this answer. I perfectly understand Anyway, I expect my customer Crédit Agricole to be quite pushy on this one for it's golive which was planned for the may 13. Can you reach out with your customer manager in order to priorize this story ?

          Thx,
          Pierre-Julien Cazaux

          Show
          Pierre-Julien Cazaux added a comment - Hello Sylvain and thank you for this answer. I perfectly understand Anyway, I expect my customer Crédit Agricole to be quite pushy on this one for it's golive which was planned for the may 13. Can you reach out with your customer manager in order to priorize this story ? Thx, Pierre-Julien Cazaux
          Hide
          Sylvain Guittard added a comment -

          Can you reach out with your customer manager in order to priorize this story ?

          We are already in contact. We cannot promise this feature will be added.

          Show
          Sylvain Guittard added a comment - Can you reach out with your customer manager in order to priorize this story ? We are already in contact. We cannot promise this feature will be added.
          Hide
          Pierre-Julien Cazaux added a comment -

          Ok thx.

          Show
          Pierre-Julien Cazaux added a comment - Ok thx.
          Show
          Dawid Parafiński added a comment - https://github.com/ezsystems/ezpublish-kernel/pull/2306
          Show
          Andrzej Longosz added a comment - Merged into master a.k.a 7.2 : https://github.com/ezsystems/ezpublish-kernel/commit/44e556c3cf8f6acbf4c917242189954b914e3c93
          Show
          Dominika Kurek added a comment - Doc PR: https://github.com/ezsystems/developer-documentation/pull/276

            People

            • Assignee:
              Unassigned
              Reporter:
              Kamil Madejski
            • Votes:
              3 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile