How can you render widgets from a different page in Kentico?

Jeevan Jose asked on November 25, 2016 01:58

I'm working with a Kentico application that uses the 'ASPX + Portal Engine' template type. In one of the pages, I need to display all the widgets and web parts (basically the whole page) from all it's child nodes.

If I use the 'Portal Engine' template type and have the following code in a user control, it works just fine:

<asp:Repeater runat="server" ID="ChildPagesRepeater" ItemType="CMS.DocumentEngine.TreeNode">
    <ItemTemplate>
            <div>
                <p><%# Item.DocumentPageTitle %></p>

                <cms:CMSPagePlaceholder runat="server" ShortID="p" Path="<%# Item.NodeAliasPath %>" />

            </div>
    </ItemTemplate>
</asp:Repeater>

In the CodeBehind, I set the DataSource for the ChildPagesRepeater to the TreeNode children of the CurrentDocument and this 'just works'. But it just won't work with 'Portal Engine + ASPX' templates. What am I missing here?

My last resort is to use a WebClient to get the child pages' markup and render it directly but I'd rather do it the 'proper' way. I've tested this and this does work but it doesn't feel like the 'right' way to do this.

Recent Answers


Trevor Fayas answered on November 25, 2016 15:11

You only need to post on stack overflow or here, there's a feed that shows up the questions (so this is showing up twice).

To copy and paste my answer from stack overflow:

I've done this trick but only in portal, i can only guess if the same thing done in portal+aspx.net doesn't work, that the coding difference in one rendering all the zones and the other only loading webparts into the existing zones may be the issue.

Out of curiosity, why are you doing aspx.net+portal? There is very little you can't do in pure Portal (plus a custom control) than you can do in aspx.net+portal, plus it's super annoying to have a hard coded master template. I would convert.

0 votesVote for this answer Mark as a Correct answer

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