Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > How to force specific transformation? View modes: 
User avatar
Member
Member
liquidator - 3/9/2010 7:42:05 AM
   
How to force specific transformation?
I wonder how the portal template works out what transformation to use. I suppose, knowing the type of the document being rendered, it looks at all webparts on the page that display the same document type and somehow picks their transformation or selected item transformation. Does it work something like this?

My problem is with product list page and product detail page. Everything works fine with the standard cmsdatalist displaying product list with a template specified in the transformationname property and individual products using the template specified in selecteditemtransformationname property. In my case I have my own web part to display the product list but that web part loads the datalist from the client on demand (AJAX). This datalist has set both the transformations. When I click through to an individual product it will not pick up the selected item transformation. How do I force the transformation on my custom control?

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 3/10/2010 3:35:54 AM
   
RE:How to force specific transformation?
Hello,

Basically it depends on document types specified in 'Document types' property of web part - if doc. type of current document is included in the list the 'selected item transformation' is used, otherwise 'default' transformation is used.

I think the problem with your approach is that system doesn't actually open the actual product document when you select it in datalist because you use AJAX. You will need to check in your code if/what item has been clicked and if the item is clicked you will need to set wherecondition of datalist to display only selected item and also set name of transformation from 'Selected item transformation' field into 'Transformation' field in this case.

Best Regards,

Martin Dobsicek

User avatar
Member
Member
liquidator - 3/10/2010 5:26:22 PM
   
RE:How to force specific transformation?
Thanks very much for your quick response. It did the trick as you said. I needed to add a static datalist on a webpart and set the document type and transformation. This web part has StopProcessing true on the product list and StopProcessing false on the single product page - not sure why but just as I need!

Hope this helps others.