Visual

Latest blog post

Tweaks: Adding custom page layout codes

18 October 2012, 0 comments
In this tweak I will add a custom element that will allow me to easily add a code snippet needed for multiple placeholders. For more information regarding multiple placeholders please read this blog post.

First locate the file CMSFormControls\Layouts\PageLayoutCode.ascx.cs and add the following code in the specified lines:

Line 150:
drpElements.Items.Add(new ListItem(GetString("PageLayout.MultiplePlaceHolder"), "mpl"));


Line 177-179:
case 'mpl':
            elem = '<cms:CMSContent runat=""server"" id=""cntContent"" PagePlaceholderID=""plcContent""><cc1:CMSWebPartZone ID=""zoneA"" runat=""server"" /></cms:CMSContent>';
            break;  


This should look similar to the following screen:

Page layout code

Next make sure to add the localization string in the UI Cultures module:

Key: PageLayout.MultiplePlaceHolder
Text: Multiple placeholders

View the result:

Page template layout properties

Enjoy :)
Filed under: Snippets, Tweaks, Kentico

Comments
Blog post currently doesn't have any comments.
Leave comment



 Security code

Search

Related posts

Widgetizer v1.0

I have created a downloadable package for my latest tweaks: "Widgetize!" and "Copy web part". The tweaks will update the... read more

Tweaks: Hide not translated documents from the content tree

This post covers a tweak which I find useful when working with multiple cultures. The tweak hides documents which are not... read more

Widgetizer v1.1

When creating websites with Kentico CMS, I often find myself adding default web part properties so that I can specify... read more

Nothing going on…

Hi guys, I guess it is time for an update! My vacation is coming up and I did not find any time to write new posts. I... read more

Tweaks: Widgetize!

This tweak will allow you to create configured widgets from your configured web parts. It works as follows. I have... read more