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

viewType is ignored for ContentType = image in render_esi viewLocation

    Details

      Description

      ViewType specified in render_esi( controller( "ez_content:viewLocation", is being ignored, of the ContentType being rendered is an image. default.html.twig is always being used.

      steps to reproduce.
      • Publish an image somewhere in the content tree
      • Override a template to include the following:

        {{ render_esi( controller( "ez_content:viewLocation", {"locationId": 109, "viewType": "line"} ) ) }}
        

      • Include the following in ezplatform.yml

        ezpublish:
            system:
                site_group:
                    location_view:
                        line:
                            image:
                                template: ":Image:line.html.twig"
                                match:
                                    Identifier\ContentType: [image]
        

      • include a custom line..html.tiwg file under app/Resources/views/Image folder
        => expected result: The image should be rendered using your customized line.html.twig
        => actual result: eZStudioDemoBundle:default:default.html.twig is used, instead
      notes:
      • location_id = 109 was the id in my case. Please update to the id of your case image, in order to reproduce the issue
      • changing line to a different value such as test has no effect.

        Issue Links

          Activity

          Hide
          Eirik Alfstad Johansen added a comment -

          I can confirm that this happens only for the Image content type. When creating an exact duplicate of this content type, in the same content type group, with the only difference being the content type identifier changed from image to image_copy, the view provider configuration works as expected.

          Show
          Eirik Alfstad Johansen added a comment - I can confirm that this happens only for the Image content type. When creating an exact duplicate of this content type, in the same content type group, with the only difference being the content type identifier changed from image to image_copy, the view provider configuration works as expected.
          Hide
          Bertrand Dunogier added a comment - - edited

          Note that view_location is actually deprecated in Platform. ez_content:viewAction should be used instead.

          In addition, there is a dedicated feature to handle default view templates (https://doc.ez.no/display/TECHDOC/Default+view+templates).

          Also, Studio's demo bundle isn't meant to be used as a basis for projects (just like Platform).

          Show
          Bertrand Dunogier added a comment - - edited Note that view_location is actually deprecated in Platform. ez_content:viewAction should be used instead. In addition, there is a dedicated feature to handle default view templates ( https://doc.ez.no/display/TECHDOC/Default+view+templates ). Also, Studio's demo bundle isn't meant to be used as a basis for projects (just like Platform).
          Hide
          Eirik Alfstad Johansen added a comment -

          > Also, Studio's demo bundle isn't meant to be used as a basis for projects (just like Platform).

          Use of the demo bundle as a basis was never my intention, but it seems to be default behaviour out of the box (and I have not located any docs mentioning how to disable this).

          Show
          Eirik Alfstad Johansen added a comment - > Also, Studio's demo bundle isn't meant to be used as a basis for projects (just like Platform). Use of the demo bundle as a basis was never my intention, but it seems to be default behaviour out of the box (and I have not located any docs mentioning how to disable this).
          Hide
          Bertrand Dunogier added a comment -

          Use of the demo bundle as a basis was never my intention, but it seems to be default behaviour out of the box (and I have not located any docs mentioning how to disable this).

          I understand, it's a very valid point. We have notified the teams about that.

          Show
          Bertrand Dunogier added a comment - Use of the demo bundle as a basis was never my intention, but it seems to be default behaviour out of the box (and I have not located any docs mentioning how to disable this). I understand, it's a very valid point. We have notified the teams about that.
          Hide
          Kamil Musiał (Inactive) added a comment -

          We provide eZStudioDemoBundle as showcase of eZ Studio. There are sample implementations of design elements. Like Bertrand Dunogier said, it's not a base for projects.
          There are two ways to resolve that situation:

          Solution #1

          Due to Symfony2 loading mechanism, bundles are loaded last and have the highest priority, so you can place your app in a bundle and load it last in AppKernel.php. Then every studio demo config will be overwritten.

          Solution #2

          Other way is disable the eZStudioDemoBundle from AppKernel.php, then only your config will be present. This one generates extra work, you have to take care of content existing in studio demo and every template used in it (location views, block templates, page design, etc.). You can always remove all the content in Home root, then disable the demo bundle and you shouldn't have any exceptions thrown then.

          In version 16.04 we will provide a clean installer without demo content and with generic landing page block templates, where you can create your design and place a config wherever you'll want.

          Show
          Kamil Musiał (Inactive) added a comment - We provide eZStudioDemoBundle as showcase of eZ Studio . There are sample implementations of design elements. Like Bertrand Dunogier said, it's not a base for projects. There are two ways to resolve that situation: Solution #1 Due to Symfony2 loading mechanism, bundles are loaded last and have the highest priority, so you can place your app in a bundle and load it last in AppKernel.php . Then every studio demo config will be overwritten. Solution #2 Other way is disable the eZStudioDemoBundle from AppKernel.php , then only your config will be present. This one generates extra work, you have to take care of content existing in studio demo and every template used in it (location views, block templates, page design, etc.). You can always remove all the content in Home root, then disable the demo bundle and you shouldn't have any exceptions thrown then. In version 16.04 we will provide a clean installer without demo content and with generic landing page block templates, where you can create your design and place a config wherever you'll want.
          Hide
          Yannick Roger (Inactive) added a comment -

          Dominika Kurek Hi could the solutions be added to the studio documentation affecting 16.02

          Show
          Yannick Roger (Inactive) added a comment - Dominika Kurek Hi could the solutions be added to the studio documentation affecting 16.02
          Hide
          Dominika Kurek added a comment -
          Show
          Dominika Kurek added a comment - [~yannick.roger@ez.no] Added a note in https://doc.ez.no/display/TECHDOC/eZ+Studio+16.02+Release+notes
          Hide
          Miguel das Neves Jacinto (Inactive) added a comment -

          Verified by QA

          Show
          Miguel das Neves Jacinto (Inactive) added a comment - Verified by QA

            People

            • Assignee:
              Unassigned
              Reporter:
              Joaquim Cavalleri (Inactive)
            • Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: