Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Page Layouts and Webparts View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 12/5/2011 11:31:05 PM
   
Page Layouts and Webparts
I've got a master page that all my page pages inherit and each of the pages have two choices for a layout: full and a 30/70 split. On the 30/70 layout, I'd like to always have the same 2 webparts in a zone but can only control webparts from the page level, not the layout level. How can I achieve this? Ideally, I want a static text and a most active forum threads webparts in the zoneLeft webpart. In the page, there is some XML I can edit but don't want to do it for all 60-70 pages, when 90% of them use the left layout.

I don't have the option to put it in the site's master page as the master page can have different layout options. Here is my page layout code:


div class="pageLeftTop">
</div>
<div class="pageLeftMid">
<div class="leftcontentLeft">
<asp:Image ID="imgLogo" runat="server" style="display: block; margin-left: auto; margin-right: auto;" ImageUrl="~/App_Themes/site/Images/Logo.png" ToolTip="Logo" />
<cc1:cmswebpartzone id="zoneLeft" runat="server" />
</div>
<div class="maincontentLeft">
<div>
<div style="float: left; width: 50%;">
<cc1:CMSWebPartZone id="zoneTopLeft" runat="server" />
</div>
<div style="float: right; width: 50%;">
<cc1:CMSWebPartZone id="zoneTopRight" runat="server" />
</div>
</div>
<div class="clear"></div>
<cc1:cmswebpartzone id="zoneRight" runat="server" />
<div>
<div style="float: left; width: 60%;">
<cc1:CMSWebPartZone id="zoneMiddleLeft" runat="server" />
</div>
<div style="float: right; width: 40%;">
<cc1:CMSWebPartZone id="zoneMiddleRight" runat="server" />
</div>
</div>
<div class="clear"></div>
<cc1:CMSWebPartZone id="zoneMiddle" runat="server" />
<div>
<div style="float: left; width: 50%;">
<cc1:CMSWebPartZone id="zoneBottomLeft" runat="server" />
</div>
<div style="float: right; width: 50%;">
<cc1:CMSWebPartZone id="zoneBottomRight" runat="server" />
</div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="pageLeftBot">
</div>


User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 12/6/2011 3:22:19 AM
   
RE:Page Layouts and Webparts
Hello,

Regrettably, I am a bit confused about your setup. Why do you want to change the XML directly? Have you considered using pre-defined templates and ad-hoc templates for your pages? What's the problem of placing your two web parts into the left zone and using this template afterwards? You can also consider creating the left zone as a separate level in your page structure and using a placeholder for the display of the 70% zone, so you hierarchy will be something like:

Master page
- 30 % template with page place holder on the 70% zone
- - full layout

Now you can also set the inheritance levels according to your needs, so you can inherit the 30 % left column, or not and you will have a full page layout without the left side column.

If this won't cover your scenario, could you please describe your issue with some example and what are the problems of the mentioned approaches?

Best regards,
Boris Pocatko

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 12/6/2011 7:38:52 AM
   
RE:Page Layouts and Webparts
Thanks for the followup Boris, unfortunately, I'm even more confused as to your response now. I am using templates and layouts for all my pages. All pages inherit the master page and each page after that can have 1 of 2 layouts: full or 30/70 split. In both layouts there are different zones specified already.

Ideally, I don't want to edit the XML directly. But I think I might understand now what you are saying. If I create the page template and have the 30% within that template I can then choose to use the 70% layout which will allow for different webparts to be placed in the zones I have created. If I then have a page that I still want the 30/70 split but want to add or remove webparts from the 30% side, I can then create a unique template for that page correct?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 12/6/2011 8:05:22 AM
   
RE:Page Layouts and Webparts
Hello,

I am sorry I've confused you. I am not completely sure, if we understand each other. To summarize, you can use a template and add the web parts to that template. If you need a different one, you can simply create an ad-hoc template from it. You don't have to use the approach with the page place holder, it was just a suggestion. Lets assume we understand each other and if you run into a problem, you will let us know ;)

Best regards,
Boris Pocatko