Chris’s SharePoint Reflections

Just another WordPress.com weblog




  • Chris Zhong

    IT consultant Australia








Archive for September, 2008

Deploy Master Page and Page layout as a feature

Posted by chrissyz on September 24, 2008

 

The following is the detailed the instructions of how to deploy Master Page and Custom Page Layout together

 

1.       The following is the directory structure which I suggest when creating your own features

 

       2.       Under the PageLayouts folder you will see two files:

·         MoscowLayout.aspx: this page is the custom page layout you created

·         MoscowLayout.xml: this is the manifest files that identifies your custom page layout

 

               You can put as much as custom page layout pages as you want in this folder, but you only need

               one manifest file

 

3.       The content of MoscowLayout.xml should be looks like:

 

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/” >

                <Module Name =”MOSCOWPageLayouts” Url =”_catalogs/masterpage”

                                 Path =”PageLayouts” RootWebOnly =”TRUE”>

                                <File Url =”MoscowLayout.aspx” Type =”GhostableInLibrary”>

                                                <Property Name =”Title” Value=”XXX”/>

                                                <Property Name =”MasterPageDescription” Value=”XXX”/>

                                                <Property Name =”ContentType” Value =”$Resources:cmscore,contenttype_pagelayout_name;”/>

                                                <Property Name=”PublishingPreviewImage” Value =”~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/ArticleLeft.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/ArticleLeft.png”/>

                                </File>

                </Module>

</Elements>

 

 

 Module:   indicate to SharePoint the location of the aspx pages. MoscowLayout.aspx is part of your feature and must be copied along with all of the other parts to the features folder. During the activation of your feature, it will be dropped in the Master Page and Page Layout gallery.

 

File:  defines the path to your page and the type. GhostableInLibrary tells SharePoint to create a list item to go with your file when it is added to MasterPage and Page Layout gallery.  Ghostable  is used if you are provisioning a file outside a document library

 

Two important properties:

ContentType:  OOTB Master Page Gallery has two content type associated with it. The value will either be master page or page layout.

 

Publishing AssociationConetentType: Specify ContentType to which your custom page layout is associated. The value of this one is composed of the name of your content type and the ID of content type. If this value is omitted, by default your layout will be associated with the basic ‘Page’ content type from the publishing feature

 

4.       You put your master page, css file into MoscowMasterPage. The wollongongmaster.xml manifest file should look like the following:

 

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”&gt;

                <Module Name=”MasterPages” List=”116″ Url=”_catalogs/masterpage”>

                                <File Url=”Moscow.master” Type=”GhostableInLibrary” />

                </Module>

                <Module Name=”WollongongStyles” Url=”Style Library” RootWebOnly =”TRUE”>

                                <File Url=”Moscow.css” Type =”GhostableInLibrary”/>

                </Module>

</Elements>

 

5.       Under the folder MoscowFeature, you will see Feature.xml, it will look similar to

<Feature Id=”{6EAA33DF-AD39-4a2c-B5AB-972A576D7CF4}”

                                 Title=”Moscow Branding”

                Description=”Master Page and page layouts for Moscow”

                Version=”1.0.0.0″

                Scope=”Site”

                Hidden=”FALSE” xmlns=”http://schemas.microsoft.com/sharepoint/“>

                <ElementManifests>

                                <ElementFile Location=”PageLayouts\MoscowLayout.aspx”/>

                                <ElementManifest Location=”PageLayouts\MoscowLayout.xml” />

                                <ElementManifest Location =”MoscowMasterPage\wollongongmaster.xml”/>

                </ElementManifests>

</Feature>

 

It contains ElementManifest files for master page and page layout.

 

This is just an example to give you a general idea of how custom page layout should be deployed. It depends on how individual elements are structured. And install.bat file is important as well because you need to copy the files to the right location in your 12 hives.

 

Posted in Deployment | Tagged: | 11 Comments »

Farewell to Patrick Tisseghem

Posted by chrissyz on September 6, 2008

It is extremely sad for the passing of my dearest friend and mentor Patrick Tisseghem. I am still in shock and couldn’t believe this is real.

Patrick and I met in the sharepoint training course in Canberra and became good friends immediately since then. We talked about everything: dreams, beers, cars, lifes.. and of course SharePoint. He is charming, inspiring and down to earth. A man with integrity and true characters. He leads me not only in the adventurer of SharePoint but also in the journey of life.

He encouraged me to start this blog and also named it. (We had a couple of “disputes” about the name 🙂 ) And today, when I am writing his farewell here, I looked back fondly on those time. Patrick, thank YOU for making my journey in Sharepoint such a memorable experience and always be there for me during my highs and lows in life. No word can describe how deeply I will miss you, my dearest friend, may God be with you and may you rest in peace.

Posted in General | Tagged: | Leave a Comment »