Web parts within transformations

Ilya Buzytsky asked on May 26, 2016 03:39

Hi again, comparing Product Details pages of two sample sites - Dancing Goat and E-Commerce, I see the first one has one big ZoneDetail containing one Web Part with one long transformation (which includes also <cms:CMSRepeater ID="relatedProducts"), while the second sample uses many separate Web parts with short transformations each. Intuitively I like the approach of Dancing Goat, but is it possible to add more CSM controls and Web Parts to the same long transformation? Specifically, I'd like to add AttachmentsDataSource and BasicRepeater for product images (kind of Lightbox). Do I need to add more PagePlaceHolders to ZoneDetail for each Web Part/Control? If yes - how to differentiate them? Thanks, Evgeny

Recent Answers


Trevor Fayas answered on May 26, 2016 16:41

ASCX transformations can contain (theoretically) any number of controls (webparts), however performance may take a hit, especially with nested repeaters.

You usually only nest web parts though if you need repeat content, and apply some control/webpart to each item (like add a "Buy now" web part to a repeater of purchasable items).

In terms of normal pages though, you usually have your Page Layout (HTML), and you add Webpart Zones to the Layout, then add web parts to the zones. Knowing a web part can have a content-before and after, you have to gauge the usage of zones and web parts. You usually put zones as Content pockets, like the Footer you put a zone, then add various footer webparts to the zone.

PagePlaceholders you usually only use 1, and that's where sub content will be put for templates that inherit the parent.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.