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

add path_string as a override condition to replace changed url_alias condition behavior

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Obsolete
    • Icon: High High
    • Customer request
    • 3.10.0, 3.10.1rc1, 4.0.0, 4.0.1rc1, 4.3.0alpha1
    • Documentation, Misc
    • None

    Description

      before 3.10/4.0 this override rule wold trigger on the entire subtree containing matching the condition:

      [left_column_top_images2]
      Source=left_column_top.tpl
      MatchFile=left_column/top_images.tpl
      Subdir=templates
      Match[url_alias]=contact
      

      these URLS's would trigger this rule, indenpendent of the translation (language) of the node specified in the condition:
      example.com/eng/Contact
      example.com/eng/Contact/English
      example.com/eng/Contact/Support/Technical
      example.com/ger/Kontact/Supporten/Technische
      ...because the "Contact" node was stored with the string "contact" ("/contact/") in the path_identification_string field in the ezcontentobject_tree table, where the condition looks up a potential match.
      the "Kontact/Supporten/Technische" node would be stored as "/contact/support/technical/" in the ezcontentobject_tree table, and as such be a match for the "Match[url_alias]=contact" conditon.

      this will not work after a 3.10 / 4.0 upgrade, since the Multiple URL Alias feature now uses language-specific aliases.
      now the conditions will have be specified per language:

      #English
      [left_column_top_images2]
      Source=left_column_top.tpl
      MatchFile=left_column/top_images.tpl
      Subdir=templates
      Match[url_alias]=Contact
      
      #German
      [left_column_top_images2]
      Source=left_column_top.tpl
      MatchFile=left_column/top_images.tpl
      Subdir=templates
      Match[url_alias]=Kontact
      

      problem:
      a site that has a lot of override rules that depends on the old url_alias condition behavior, now have to add override rules for each language. if you have a lot of languages installed, then you suddenly get a lot of work ahead of you.

      the conditions "node_id" and "parent_node" is not good enough, as they do not include the entire subtree for the given node.
      the condition "section" requires a lot of policy changes and sectioning in the content, and is therfore impractical if you have many rules to replace.

      solution:
      we suggest that we add a new condition to the template override feature, that is language independent, and triggers on all subtrees of a given node.

      the easiest way to implement this enhancement is to use the "path_string" field in the ezcontentobject_tree table, which is node ID based (as opposed to node name based) and is a part of all nodes below the one specified.

      it will as such behave as url_alias condition used to do.

      example:

      #German
      [left_column_top_images2]
      Source=left_column_top.tpl
      MatchFile=left_column/top_images.tpl
      Subdir=templates
      Match[path_string]=/1/2/4/5/
      

      if node "contact" had path_string "/1/2/4/5/" then all nodes under this node would also have this path string included in their own path_string:
      examples:
      example.com/eng/Contact -> /1/2/4/5/
      example.com/eng/Contact/English -> /1/2/4/5/89/
      example.com/eng/Contact/Support/Technical -> /1/2/4/5/50/53/
      example.com/ger/Kontact/Supporten/Technische -> /1/2/4/5/50/42

      Attachments

        Activity

          People

            unknown unknown
            jkn jkn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: