Undoubtedly, we would use transformations and CMSRepeater to display document type data under portal engine. How about ASPX template? if we follow developer guide, we would construct a CMSRepeater like below:
<cms:CMSRepeater id="Repeater_Sample" runat="server" path="./%" class="page.menu" transformation="page.menu.title"></cms:CMSRepeater>
However, CMSRepeater inherits from asp.net repeater control. Transformation content can be placed in the Item Template. For example,
<cms:CMSRepeater id="Repeater_Sample" runat="server" path="./%" class="page.menu">
<ItemTemplate>
<%#Eval("Title")%>
</ItemTemplate>
</cms:CMSRepeater>
Which approach would you prefer? I found there are a couple of advantages to use the latter approach.
Save time
Versioning & Deployment
Also, although content staging handles all transformation updates and publish to other Kentico instances easily, it would be hard to deploy only one of many changes under same document type. In this situation, Git branching could handle it.
If using transformation, it takes few extra steps to dump all virtual objects to physical files for compilation under pre-compiled environment.
Advantage of Transformation
Transformation allows you to edit the site directly through the CMS interface. You do not need to upload any files. If your site under pre-compile environment, you can use text‑based transformations. Direct edit still possible.
What do you think? How do you use CMSRepeater?
No comments:
Post a Comment