Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Wrap transformation in code View modes: 
User avatar
Member
Member
gliker-inorbital - 8/30/2011 2:16:09 PM
   
Wrap transformation in code
Hi,

I created news transformation that repeats news items. I would like to wrap all results like this:

<div class="news">
all news items should be here
</div>.


Is there a way to achieve this other than using webpart container? Preferably I would like to add necessary code inside transformation.

Thanks


User avatar
Kentico Support
Kentico Support
kentico_radekm - 8/30/2011 8:14:50 PM
   
RE:Wrap transformation in code
Hello.

If you want to wrap all items within once only and not every single item, you need to place this code outside of transformation code. So Content before / Content after properties is very proper place for this goal.

Best Regards,
Radek Macalik

User avatar
Member
Member
gliker-inorbital - 8/31/2011 8:09:10 AM
   
RE:Wrap transformation in code
Thanks Radek,

If I use content before/after then I have to have two webparts for same news items, because I have two different designs, one for landing page and one for content pages, or I would have to add content before and after manually when webpart is embedded.

I managed to achieve what I was looking for using nested repeaters. Now all I have to do is chose transformation once and code behind/after will be automatically added. Plus, this way webpart will change text to appropriate culture automatically which means I can use same template for both languages.

Thanks,
Giuliano

User avatar
Kentico Support
Kentico Support
kentico_radekm - 8/31/2011 9:32:25 PM
   
RE:Wrap transformation in code
Hello.

I am glad you solved it like this. Just for information to other customers, more info about nesting controls (also with simple example) can be found on http://devnet.kentico.com/docs/controls/cms_listings_and_viewers_using_nested_controls.htm

Best Regards,
Radek Macalik