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

Template override conditions :: node/view/*.tpl :: parent_class_identifier condition is not always verified

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 4.0.4, 4.1.0beta1
    • 3.9.3
    • None
    • Operating System: Win XP
      PHP Version: '4.4.4'
      Database and version: Mysql 5
      Browser (and version): Mozilla

    Description

      It seems that there is a problem with this condition.
      We've been using it without any problem, but in a special case, the result is not the expected one.

      The condition is not verified and another template is used intead of the good one.
      The case is a bit tricky to explain but i'm giving a try.

      Steps to reproduce

      We've got 2 templates :: for the following contenttree structure :

      ParentNode[Article]
       
      ---> Node_1 [ArticlePage]
      ---> ...
      ---> Node_n [ArticlePage]
      ParentNode[Trophy]
       
      ---> Node_1 [ArticlePage]
      ---> ...
      ---> Node_n [ArticlePage]

      When viewing an [ArticlePage] node in the case of a full view of this content, we do some work on the template, asking for a navigation view of the parent node followed by a call to the 'sub_page' view of the current_node (ArticlePage class type) child of a Trophy class type.

      which is equivalent to :

      {node_view_gui view='navigation' content_node=$node.parent} {node_view_gui view='sub_page' content_node=$node}

      The override is the following :

      [sub_page_trophy_article_page]
      Source=node/view/sub_page.tpl
      MatchFile=sub_page/article_page.tpl
      Subdir=templates
      Match[class_identifier]=article_page
      Match[parent_class_identifier]=trophy

      [sub_page_article_article_page]
      Source=node/view/sub_page.tpl
      MatchFile=sub_page/article_page2.tpl
      Subdir=templates
      Match[class_identifier]=article_page

      In this case, the 'sub_page_article_page' is used. Which is cool since it's what we want.

      But, when viewing an article, we call the 'sub_page' view of the first child (i.e. the Node_1 node in our case) with the following code (simplified for the exemple)

      {node_view_gui view='navigation' content_node=$node} {node_view_gui view='sub_page' content_node=$node.children.0}

      In this case, with the same override conditions, the first one is not used, but the scond is used instead.

      Which is not cool. It seems that only "template keys" of the first node viewed (here, the trophy) are used. The parent of the trophy is not a trophy, so the first condition is not respected, continuing with the second condition that is respected.

      But since it is the 'sub_page' view of an article_page class, child of a trophy class, why does the first condition is not respected?

      Attachments

        Activity

          People

            andre1 andre1
            vaseltior vaseltior
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: