CHUVASH.eu

CHunky Universe of Vigourous Astonishing SHarepoint :)

Tag Archives: page layout

Add article content and editing to your Page Layout

If you work with Sharepoint Designer, use your own page layouts and want to have them for a page in a publishing site, you have to put in some controls in order to see th page content in you custom page layout. Put in a appropriate place in you page layout ( taken from ArticleLeft.aspx):

<div>
	<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
		<SharePoint:TextField runat="server" FieldName="Title"/>
	</PublishingWebControls:EditModePanel>
	<div class="captioned-image">
		<div class="image">
			<PublishingWebControls:RichImageField FieldName="PublishingPageImage" runat="server"/>
		</div>
		<div class="caption">
			<PublishingWebControls:RichHtmlField FieldName="PublishingImageCaption"  
				AllowTextMarkup="false" AllowTables="false" AllowLists="false" 
				AllowHeadings="false" AllowStyles="false" AllowFontColorsMenu="false" 
				AllowParagraphFormatting="false" AllowFonts="false" PreviewValueSize="Small" 
				AllowInsert="false" runat="server"/>
		</div>
	</div>
	<div class="article-header">
		<div class="date-line">
			<SharePoint:DateTimeField FieldName="ArticleStartDate" runat="server"/>
		</div>
		<div class="by-line">
			<SharePoint:TextField FieldName="ArticleByLine" runat="server"/>
		</div>
	</div>
	<div class="article-content">
		<PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" 
			HasInitialFocus="True" MinimumEditHeight="400px" runat="server"/>
	</div>
	<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel roll-up">
		<PublishingWebControls:RichImageField FieldName="PublishingRollupImage" 
			AllowHyperLinks="false" runat="server" />
		<asp:Label text="<%$Resources:cms,Article_rollup_image_text%>" runat="server" />
	</PublishingWebControls:EditModePanel>
</div>

Custom PlaceHolder

You want some custom content in your site and it is different from page to page. Well, I wrote how to achieve this with delegate controls. Another approach is to use PlaceHolders. Maybe you can use some existing placeholders. There are so many unused placeholders in v4.master. Like PlaceHolderLeftActions. If you use starter master pages from Randy Drisgill, you must move these from invisible panel.

To create custom placeholder is very easy:

Just copy an existing placeholder in the master page and name it som appropriate like:

<asp:ContentPlaceHolder 
       id="PlaceHolderLeftNavBarContoso" 
       runat="server" />

In your custom page layout, or application page, just add asp:Content and put your html there:

<asp:Content 
        ContentPlaceHolderID="PlaceHolderLeftNavBarContoso" 
        runat="server">
           Hello World
        </asp:Content>

Show Title on Page

If you want to show the page title in another part than defined in your master page just add this tag to your page layout.

<SharePoint:ProjectProperty 
    Property="Title" runat="server" />

It must be within <asp:Content> tag

Webparts on a layoutpage which is provisioned several times

It is pretty easy to add webparts to a layout page. Just define the webparts in the corresponding Elements.xml file. Like you do in onet.xml. It works fine if you provision just a single page with this layout on a web. If you have multiple pages that use the same page layout (e.g. in WCM). The trick is to use the attribute IgnoreIfAlreadyExists in the File tag:

IgnoreIfAlreadyExists="True"
Discovering SharePoint

And having fun doing it

Bram de Jager talking Office 365, SharePoint and Azure

My view and thoughts on Productivity and more.

My programming life

and everything in between

SharePoint Development Lab by @avishnyakov

It is a good place to share some SharePoint stories and development practices.

SharePoint Dragons

Nikander & Margriet on SharePoint

RealActivity - Real-time and trustworthy

Blog site of founder, RealActivty - Paul J. Swider

Mai Omar Desouki - Avid SharePointer

Egyptian & Vodafoner - Senior SharePoint Consultant

Cameron Dwyer | Office 365, SharePoint, Outlook, OnePlace Solutions

Office 365, SharePoint, OnePlace Solutions & Life's Other Little Wonders

.:paul.tavares:.

Me and My doings!

Share SharePoint Points!!

By Mohit Vashishtha

Jimmy Janlén "Den Scrummande Konsulten"

Erfarenheter, synpunkter och raljerande om Scrum från Jimmy Janlén

SPJoel

SharePoint for everyone

SharePointRyan

Ryan Dennis is a SharePoint Solution Architect with a passion for SharePoint and PowerShell

SharePoint 2020

The Vision for a Future of Clarity

Aharoni in Unicode, ya mama

Treacle tarts for great justice

... And All That JS

JavaScript, Web Apps and SharePoint

blksthl

Mostly what I know about SharePoint - CommunicoCuspis