Search code examples
componentspipelineintershopviewcontext

Intershop - pass call parameters to component


This question is related to this thread: Cannot Access Pipeline Dictionary Entry of View Pipeline in a Component

I want to pass a pipeline parameter to a component which is referred to somewhere after a Tag. I don't really understand how this works. Do I have to override a viewcontext or just its interface?

The ViewContext ist called via the tag previously mentioned, and I need a pipeline parameter in the component "component.product.productTile.pagelet2" - but I cannot understand what I need to override to pass my parameter along.

Also I may have overridden the components in the wrong cartridge. I take it, that my override has to be in the app_sf_responsive_cm? Or do I hav eto override 2 things in different cartridges?

Because the viewcontext ist "viewcontext.include.product.pagelet2" which resides in app_sf_responsive. So I am quite confused, really. If somebody could help me that would be great.

I tried overriding the "component.product.productTile.pagelet2" and the "viewcontext.include.product.pagelet2" by adding the tag with my parameter as explained on the intershop documentation cookbook.


Solution

  • I suggest you don't do any overriding. You can edit the related pagelet models directly at the place where they are delivered by Intershop. That means directly in the app_sf_responsive... cartridges. Passing call parameters is hard enough already don't bother with that overriding complexity.

    Product tiles are always rendered using waincludes (aka. remote includes). That means another webadapter application server interaction is necessary to resolve this. There is a hidden feature which allows you to basically copy a query-parameter value (from the top level request) into such a remote include. Insert this and adapt to your liking in your component.product.productTile.pagelet2

        <callParameterDefinitions xsi:type="pagelet:CallParameterDefinition" name="ParameterInside"
            type="java.lang.String" from="ParameterFromBrowserURL"/>
    

    This should propagate the value out of https://host/INTERSHOP/web/.../pipeline?ParameterFromBrowserURL=AAA into your tile. Make sure you switch ON Page Cache and DO NOT test this inside Design View as in both cases remote includes are treated as local includes (copy does not happen there).