How to add the quick launch to the default Web Part Page templates

This article was published on my previous blog located at http://blog.avanadeadvisor.com/blogs/patrick_boom in January. I moved it here.

One day, one of our end-users raised the question why the quick launch navigation bar was not visible when adding a new page to an existing site. The user chose the Web Part Page in the Create menu to create a new web part page on the site. After creation, the new page did not show the quick launch bar.

 When diving into the issue, indeed, the standard out-of-the-box page templates (8 templates) do not include this bar. To me, this was quite strange, as I could not think of any reason why this would be desired. Nevertheless, when researching the page templates, the default templates override the master page to omit the quick launch navigation bar. And so, the journey to have them added begins.

 How are the standard Web Part Page templates called and referenced?

Upon first research I found that the standard 8 templates are hard referenced in a page called spcf.aspx by the create.aspx page. The create.aspx page is the page shown when clicking Create from the Site Settings menu. The Web Part Page option points to a file called spcf.aspx which shows the New Web Page dialog that includes the page layout selection. On this page, 8 page layout options are available by default, dividing the available space in several web part zones in different layouts. The available templates are hardcoded in this page.

 Possible approaches

There are several approaches one could take in solving this. For example:

1.       Locate the standard page templates on disk and modify them

This involves opening the standard page templates in an editor like Visual Studio, look up the overrides off the content placeholder where the quick launch navigation bar resides in the master page and remove them.

2.       Keep the existing page templates, but make copies

This involves copying the existing page templates, rename them and then edit them and remove the overrides. Disadvantage would be that we have to change the spcf.aspx page to reference the new templates instead of the standard ones, as these are hard-coded.

3.       Keep existing page templates and spcf.aspx, but make copies

Same approach as option 2, but also copying the spcf.aspx page and rename it. This would introduce another disadvantage that we have to change the create.aspx as the spcf.aspx is hard referenced in there.

Several other approaches using Javascript on the client with iframes are also an option, but I was looking for a neat solution on the server, without using Javascript. All of these options involve changing default out-of-the-box files of SharePoint, which could lead to problems when applying service packs or hot fixes, as well could cause limited support on the standard installation by Microsoft. Option 3 is described by Paul Papanek in his blog found here: http://mindsharpblogs.com/pauls/archive/2008/08/19/7488.aspx

 How to do it without changing any of the standard SharePoint files?

At my current customer, we have several restrictions when applying modifications to the SharePoint landscape. First, none of the out-of-the-box files are allowed to be touched. Secondly, any modifications to the system must be done through a feature packaged in a WSP.

These restrictions rule out all the approaches described above. Secondly, it removes the possibility for creating Web Part Pages without the navigation, for which there could be valid reasons. I have found a way to include them, without touching the OOB files and still honoring the restrictions I had. To be fair though, it is a mere extension of the approach that Paul describes in his blog, so also credits to him. Now, without further due, let us continue to the solution.

 THE SOLUTION

There are several steps that need to be taken, which I will describe in detail below. Let us first outline the steps:

1.       Create a new Visual Studio empty solution that will host your new feature.

2.       Copy the standard page templates and rename them

3.       Edit the renamed templates to include the quick launch again

4.       Save the preview images for all the standard templates to a location which you can find later

5.       Create a new spcf.spx page based on the standard one and modify it to reference the new layouts

6.       Create an additional menu option on the Create page to point to your new spcf.aspx page

7.       Package all the files into a feature

8.       Package the feature in a WSP

 Create a new Visual Studio empty project that will host your new feature

Within Visual Studio, create a new empty project to host your new feature. You can use any project type you are accustomed with to create SharePoint features, I just use an empty project. I also use the WSPBuilder extensions to create a WSP, but creating the WSP is out of scope of this blog.

Within your project, create a folder structure to represent your 12 hyve that includes all the locations where we will deploy files, as shown in the attachement PageLayouts Image 1.png
 

Copy the standard page templates and rename them

The standard Web Page Page Layouts are located in the 12\Templates\1033\STS\DOCTEMP\SMARTPGS directory, where 1033 stands for English. If you have another language version installed, please replace 1033 with the language identifier installed.

In there, you will find 9 files, of which 8 are aspx pages, called spstd1.aspx through to spstd8.aspx. Make a copy of these files and include them in your project in the same folder. Make sure you rename them to any name you wish, but keep the number suffix, for example, avanade1.aspx.

 

Edit the renamed templates to include the quick launch again

Open each file in Visual Studio and remove the following lines to add the quick launch again:

asp:Content ContentPlaceHolderId=”PlaceHolderLeftNavBar” runat=”server”>asp:Content>

asp:Content ContentPlaceHolderId=”PlaceHolderNavSpacer” runat=”server”>asp:Content>

Save and close each file.

 

Save the preview images for all the standard templates

To preserve the preview image for each page template, we copy the preview images for each template to our solution. The preview images are located at 12/TEMPLATES/LAYOUTS/1033/IMAGES and are called SPSTD1.gif to SPSTD8.GIF. Rename the images to the same name used for the templates in previous steps, for example avanade1.gif.

 

Create a new spcf.aspx page based on the standard one and modify it to reference the new layouts

 Paul Papanek included a custspcf.aspx on his blog that also removes the limitation of 8 templates, as the current 2007 implementation of spcf.aspx does. It is therefore recommended to use the one provided by Paul as the basis. You can download it from here http://www.dontpapanic.com/download/custspcf.aspx.txt. You can also copy the existing one from 12/TEMPLATES/LAYOUTS/1033, where again, 1033 is your language identifier.

 Include the file in your project and open it in the editor. You may rename the file to any name you want, I just use custspcf.aspx to keep the relationship to spcf.aspx intact. There are a couple of things that you need to change in this file to make it work with your newly created template and images. Do a search on ‘custom1’ and replace all the references to this with the name of your own custom templates, in our example I would replace ‘custom1’ with ‘avanade1’ and so on. 

Also find the

 SELECT id=”onetidWebPartPageTemplate” name=”WebPartPageTemplate” size=”2″ onchange=”DoTemplateOptionChange()”>

 tag, which includes all the possible template options. In the file downloaded from Paul, only two exist. If you take the one from the original spcf.aspx, you will find 8 options.  Modify the ‘size’ attribute to reflect the number of copied templates, in our case 8. I added the options exactly as they were in the original file, just renamed the template names, as shown below:

 SELECT id=”onetidWebPartPageTemplate” name=”WebPartPageTemplate” size=”8″ onchange=”DoTemplateOptionChange()”>

  OPTION value=”avanade1″>Full Page, VerticalOPTION>

  OPTION value=”avanade3″>Header, Left Column, BodyOPTION>

  OPTION value=”avanade4″>Header, Right Column, BodyOPTION>

  OPTION value=”avanade2″ selected=”true”>Header, Footer, 3 ColumnsOPTION>

  OPTION value=”avanade5″>Header, Footer, 2 Columns, 4 RowsOPTION>

  OPTION value=”avanade6″>Header, Footer, 4 Columns, Top RowOPTION>

  OPTION value=”avanade7″>Left Column, Header, Footer, Top Row, 3 ColumnsOPTION>

  OPTION value=”avanade8″>Right Column, Header, Footer, Top Row, 3 ColumnsOPTION>

SELECT>

 In fact, most of the work is now done. The only thing left is ensure that we can call our new pages from the Create page in the SharePoint UI.

Create an additional menu option on the Create page to point to your new spcf.aspx page

Most menus in SharePoint can be extended with custom actions, like context menus, the Site Actions and so on. This is because these menus also use the FeatureLinks feature that allows additions to this menu. We will use this to add our custom option to the Create page.

Create a feature.xml within our feature folder in our solution, in my case called Avanade.PageLayouts.  The contents of the feature.xml is shown below:

<?xml version=”1.0″ encoding=”utf-8″?>
<Feature 
  Id=”ECBCD0E9-C2B3-4dc0-A6B8-63846000CB83″
  ImageUrl=”avanade.gif”
  Title=”Avanade – Custom Web Pages Menu Option”
  Description=”Enables a custom menu item for creating Web Part Pages with quick Launch navigation.”
  Version=”12.0.0.0″
  ActivateOnDefault=”FALSE”
  Scope=”Farm”
  Hidden=”FALSE”
  DefaultResourceFile=”core”
  xmlns=”http://schemas.microsoft.com/sharepoint/“>
  <ElementManifests>
    <ElementManifest Location=”CustomWebPages.xml” />
  </ElementManifests>
</Feature>

The feature refers to an ElementManifest called CustomWebPages.xml which will include the menu option. In my case, I scoped the feature to Farm, enabling the custom templates across all sites in the Farm. You can use WebApplication, Site or Web scope if desired.

The contents of CustomWebPages.xml is shown below.

<xml version=”1.0″ encoding=”utf-8″?>
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/“>
  <CustomAction
        Id=”CustomWebPageSettings”
        Title=”Web Part Page with Quick Launch”
        Description=”Create a Web Part Page with quick launch navigation”
        Location=”Microsoft.SharePoint.Create”
        GroupId=”WebPages”>
    <UrlAction Url=”_layouts/custspcf.aspx” />
  </CustomAction>
</Elements>

 Within this file, we define a custom action with the following attributes:

Id: Identifies your custom action
Title: Is shown in the user interface as the menu option
Description: Is shown on top of the page as description of the menu option
Location: Determines the location (page) to apply the custom action on. In our case, this refers to the Microsoft.SharePoint.Create location, which is the Create.aspx page.
GroupId: Identifies the menu (column) to add the option to, in our case the ‘WebPages’ column.
UrlAction: Identifies the page called when clicking the menu option, in our case, this should point to our newly created custspcf.aspx page, which completes the circle.

 That’s it! Only thing left is to package the feature into a WSP to facilitate easy distribution and installation. If you do not use a WSP, you should also include an ElementManifest to deploy the different files to their location. When creating a WSP from this folder structure, WSPBuilder will take care of the deployment of the files for you.

I hope this could be of use to you.  Happy coding!

Advertisements

90 thoughts on “How to add the quick launch to the default Web Part Page templates”

    1. Hi Greg,

      I took a look and it seems the same pages still exist in SharePoint 2010 and again the quicklaunch is missing.

      As the basic features of SharePoint have not changed (custom actions and so on) you could use the same approach for SP 2010.

      Kind regards,

      Patrick

      1. Yep,

        The same page exist on Sharepoint 2010 but the difference is that when you click on create on Sharepoint 2010, it calls a silverlight object to generate all template availables.
        I added a custspcf.aspx with the changes

        SELECT id=”onetidWebPartPageTemplate” name=”WebPartPageTemplate” size=”1″ onchange=”DoTemplateOptionChange()”>

        Custom web template

        and so on for my new templates located in 14\Templates\1033\STS\DOCTEMP\SMARTPGS

        But, it doesn’t change the silverlight generator!

      2. Yep,

        The same page exist on Sharepoint 2010 but the difference is that when you click on create on Sharepoint 2010, it calls a silverlight object to generate all template availables.
        I added a custspcf.aspx with the changes

        SELECT id=”onetidWebPartPageTemplate” name=”WebPartPageTemplate” size=”1″ onchange=”DoTemplateOptionChange()”>

        Custom web template

        and so on for my new templates located in 14\Templates\1033\STS\DOCTEMP\SMARTPGS

        But, it doesn’t change the silverlight generator!

      3. Ok, that is too bad. I might investigate that option in the future, but if you find the solution to make that work, I would be certainly interested.

        Patrick

  1. Hi Patrick,
    This article makes great sense to me, really thanks.
    In section 5 you said to search ‘custom1’, and replace all the references to this with the name of my own custom templates. But when I tried in my machine, I found there’s no ‘custom1’, in my machine they are like these:

    <SharePoint:EncodedLiteral runat="server" text="” EncodeMethod=’HtmlEncode’/>
    <SharePoint:EncodedLiteral runat="server" text="” EncodeMethod=’HtmlEncode’/>
    <SharePoint:EncodedLiteral runat="server" text="” EncodeMethod=’HtmlEncode’/>
    <SharePoint:EncodedLiteral runat="server" text="” EncodeMethod=’HtmlEncode’/>
    <SharePoint:EncodedLiteral runat="server" text="” EncodeMethod=’HtmlEncode’/>
    <SharePoint:EncodedLiteral runat="server" text="” EncodeMethod=’HtmlEncode’/>
    <SharePoint:EncodedLiteral runat="server" text="” EncodeMethod=’HtmlEncode’/>
    <SharePoint:EncodedLiteral runat="server" text="” EncodeMethod=’HtmlEncode’/>

    So they seems not same as your example?

    Br,
    William

    1. sorry, I can’t paste all of the html tags into here, I’ve sent you an email includes those html. 😉

      1. Hi William,

        Sorry for the late reply. High pressure on the project, so did not spent to much time on my blog lately.
        Anyway, are you using SP 2007? The references should be in the custspcf.aspx file you downloaded from Paul’s site.

        Kind regards,

        Patrick

  2. Patrick

    I have also noticed the missing Quick launch bar when I create a SharePoint site from a site template that previously had these. I have been brought in to improve the current situation: where the admin team re-populate the missing quick launch items by importing copies of pages (webpart pages) via spd. The pages were taken from the site that was originally used create the template.

    Should I be thinking of a vs2010 project or is there a simpler way?

    1. That is the only downside to a blog, it requires a lot of work to make it useful 😉

      Thanks.

      Patrick

  3. I truly tend to agree with the whole thing that is composed inside Roman Shades How To Make “How to add the quick launch to the default Web
    Part Page templates Patrick’s SharePoint Blog”. I am grateful for all of the information.Thank you-Harrison

  4. Great goods from you, man. I have understand your stuff
    previous to and you’re just too fantastic. I actually like what you have acquired here, certainly like what you’re
    saying and the way in which you say it. You make it entertaining and you still care
    for to keep it sensible. I can’t wait to read much more from you. This is actually a great website.

  5. “How to add the quick launch to the default Web Part Page templates Patrick’s SharePoint Blog” was in fact a wonderful posting, can not wait to look over alot more of your blog posts. Time to waste a little time online haha. Regards ,Ollie

  6. I would like to thank you for the efforts you have put
    in writing this website. I really hope to see the same high-grade blog posts by you later
    on as well. In truth, your creative writing abilities has inspired me to get my own, personal website now
    😉

  7. Hey there, I found your site wordpress.com while browsing http:
    //patrickboom.wordpress.com/2010/04/16/how-to-add-the-quick-launch-to-the-default-web-part-page-templates/.
    Have you ever considered incorporating slightly more than simply text in your articles?
    Don’t get me wrong, your writing is excellent. However just think if you were to add some awesome visuals or videos to give your posts some more “pizzazz””. Your material is great, on the other hand if you were to include more varied media, your blog could undeniably be among the best in its subject in contrast to other sites on .

  8. I do believe all of the ideas you’ve offered on your post. They’re very
    convincing and can definitely work. Nonetheless, the
    posts are too short for starters. May just you please extend them a little
    from subsequent time? Thank you for the post.

  9. Nice post. I used to be checking continuously this blog and I am
    inspired! Extremely helpful information specifically the closing part 🙂
    I care for such info much. I used to be looking for this
    certain information for a very long time. Thanks and good
    luck.

  10. Excellent post. I used to be checking continuously this weblog and I am impressed!
    Very useful information specially the ultimate part 🙂 I care for such
    info much. I used to be seeking this certain information for a
    very long time. Thanks and good luck.

  11. Great blog you have here but I was wanting to know if you knew of any community forums that cover the same topics talked
    about in this article? I’d really like to be a part of group where I can get comments from other knowledgeable individuals that share the same interest. If you have any suggestions, please let me know. Thanks a lot!

  12. Great beat ! I would like to apprentice even as you
    amend your web site, how can i subscribe for a weblog website?
    The account aided me a appropriate deal. I had been a little bit familiar of this your broadcast provided vivid transparent concept

  13. Its like you read my mind! You seem to understand so much
    about this, such as you wrote the e book in it or
    something. I believe that you simply can do with a few percent to power the message home a bit, however instead of that, this is wonderful blog.
    A fantastic read. I will definitely be back.

  14. Hey there this is kind of of off topic but I was wondering if blogs use WYSIWYG editors or if
    you have to manually code with HTML. I’m starting a blog soon but have no coding know-how so I wanted to get advice from someone with experience. Any help would be greatly appreciated!

  15. Hello! I know this is somewhat off-topic however I had to ask.
    Does operating a well-established blog such as yours require
    a massive amount work? I am completely new
    to writing a blog however I do write in my journal daily.

    I’d like to start a blog so I can easily share my personal experience and views online. Please let me know if you have any kind of suggestions or tips for brand new aspiring blog owners. Appreciate it!

  16. I’m now not sure where you are getting your information, but great
    topic. I needs to spend a while finding out
    more or understanding more. Thanks for fantastic info I was searching for this info for my mission.

  17. Your style is very unique in comparison to other people
    I have read stuff from. Thanks for posting when you have the opportunity, Guess I’ll just bookmark this web
    site.

  18. We absolutely love your blog and find a lot of your post’s
    to be exactly I’m looking for. Would you offer guest writers to write content to suit your needs?
    I wouldn’t mind producing a post or elaborating on a lot of the subjects you write in relation to here.
    Again, awesome website!

  19. An impressive share! I have jyst forwarded this onto a friend who was conducting a little homework on
    this. Andd he in fact bought me lunch due to the fact that I stumbled upon it for
    him… lol. So allow me to reword this…. Thanks for tthe
    meal!! But yeah, thanx for spending the time to discuss this matter
    here on your internet site.

  20. We’re all familiar with help files. These documents come with most software programs, and
    tell you how to use the program and its features.
    Many help files are created using Help Workshop, a free help compiler
    distributed by Microsoft. But Microsoft’s Help Workshop can be tricky to
    use on its own. That’s where programs like Shalom Help Maker come in.

    Stamp banner maker collection can take up a lot of space and containers.

    You can label each container of your stamp collection so you know what is
    in what containers.

    Next, you will need to select the effect that you want to apply to your banner.
    At the top of the panel, on the left side, you will see
    the drop down box. Drop this box down and browse through the effects to find the
    one you want to use. Once you have found the effect, you will need to click it.
    Next, you will need to select the color of the background you want.
    The color box is located right next to the effects box.
    Click the box and select the color you want to use.

    You will see a preview of the effect in the box below the effects
    drop down box.

    Font: No matter what fonts you use for your banner ads, they should be clearly readable by the visitors.

    Examples of some good fonts are Arial, Tahoma, Trebuchet, Verdana and
    some informal fonts are Comic Sans MS, Hanzel, Enview, etc.
    Your font size should be large for main heading.
    Sub-heading should contain a smaller but distinctly visible font.
    Use bold, italics or underline text formatting depending
    on importance of text in the ads.

    Next, do your homework on the site’s statistic.
    How many unique visitors do they see each month? How many clicks
    can you expect? Do they offer a pay-per-click payment structure, or is it a flat weekly or monthly rate?

    Product and logos: If your product is really innovative and
    attractive you can place a small picture of it on the banner.
    Also use of logos can make visitors to identify your brand.

    The American television producer and actor did some important
    fashion choices in the period of 80’s. In this Cosby Sweater Project,
    each episode offers different kinds of game to recreate his magic loud shirts.

  21. The teacher reads an issue to two students, and also the first one to touch their side with the board and provide the correct answer, will be the winner.
    Keeping the fun choosing 4 quick party games for adults may be the difference between an excellent party then one that’s just OK.
    For one of the most part a Brunch is the perfect time for having many different interactive
    games and printable activities for everyone to play.

  22. Of course of study with war paint it can transubstantiate
    the aspect buy twitter followers 50 titling hither inside
    of TinyMCE at the mo because TinyMCE performsn’t live what img-rounded haps to do with this especial icon.
    Maintain Ululating… because it is my strong suit. Fine, I’ll go and to ear up about 50%, eccentric in parole, 75%, sign in.

  23. Hi my family member! I wish to say that this post is amazing, nice written and come with almost all important infos.
    I would like to peer extra posts like this .

  24. Thank you a lot for sharing this with all folks you really
    recognize what you’re speaking approximately!
    Bookmarked. Kindly additionally discuss with my
    website =). We could have a hyperlink trade contract among us

  25. Hey great blog! Does running a blog similar to this require
    a great deal of work? I have absolutely no knowledge of programming
    however I had been hoping to start my own blog soon. Anyway, if you have
    any recommendations or techniques for new blog
    owners please share. I know this is off subject however I just had to ask.
    Many thanks!

  26. Hallo sir, i wanted to find out if the same technique you described above applies to SharePoint 2013/ 365, I’ve been able to make a responsive page for our organization but i have a scenario for example, if another employee decides to have a SitePage and let us say i designed responsive web part templates which they could use, will this apply? in Page section the responsiveness works very well but not the sitepage part. is it possible to customize the templates in the sitepage to be responsive? or how can he/she get the layouts without the fuss of coding from scratch?

  27. I simply couldn’t go away your site prior to suggesting that I really enjoyed the
    standard info an individual provide on your visitors?
    Is going to be again regularly to investigate cross-check new posts

  28. Hi excellent blog! Does running a blog such as this
    take a large amount of work? I have absolutely no
    expertise in computer programming but I had been hoping to start my own blog soon. Anyhow,
    should you have any ideas or tips for new blog owners please share.
    I know this is off subject nevertheless I just needed to ask.
    Thanks a lot!

  29. The other day, while I was at work, my sister stole my apple
    ipad and tested to see if it can survive a twenty five
    foot drop, just so she can be a youtube sensation. My iPad is now broken and she has 83 views.
    I know this is entirely off topic but I had to share it with someone!

  30. If some one desires expert view concerning running a blog after that i recommend him/her to go to see this weblog, Keep up the fastidious work.

  31. Mega combine sloppy deepthroat gagging girls Gagging
    compilation vol.1 Group Sex , Double Blowjob , Gagging TnaFlix Gagging ,
    Throat , Ebony 4tube Gagging , Throat , Blowjob Yobt.tv Gagging ,
    Bbw , Throat 4tube Brunette Forced Deepthroat Ass Videos & Anal Movies Index INTERCOURSE PARTICIPANT is
    the very best cellular 3gp tube availabe on Android, Iphone
    and Desktop or in MP4 format An estimate of how ceaselessly customers seek for “absolutely
    free ghetto gagging video”, on a scale from 0 to a thousand.
    Higher numbers indicate greater frequencies. Free pics
    of utmost bondage and domination. BDSM at its best Newbie Blonde Gagging Gagging Belladonna Gangbang Intercourse For Scorching Blonde Gagging Threesome Brunette Gagging On A Big
    Cock Extra Gagging Tubes Excessive Forbidden Tube’s Hot Free Associates Excessive gagging
    from an Asian Enormous Intercourse Television

  32. Great goods from you, man. I’ve take into account your stuff prior to
    and you are just extremely magnificent. I actually like what you’ve got here, certainly
    like what you are stating and the way in which during which
    you say it. You are making it enjoyable and you still care for to stay it wise.
    I cant wait to read much more from you. This is really a
    great website.

  33. Es gibt fünf Dinge, die guy letztlich besitzen muss, wenn guy den Ruhm, nach dem guy sich sehnt, in diesem Geschäft tatsächlich erreichen möchte. Es gibt viele Affiliates, pass away schnelles Geld mit weniger guten Homepages, E-Mail Aktionen oder dem Verbreiten von Affiliate Links in sozialen Netzwerken, verdienen wollen. Alles was Sie dazu benötigen ist ein Computer und eine Internetverbindung – und schon kann es losgehen!

  34. Howdy outstanding website! Does running a blog like this require
    a great deal of work? I’ve no expertise in coding but I had been hoping to start my
    own blog in the near future. Anyway, if you have any suggestions
    or tips for new blog owners please share. I know this is off subject but I just wanted to ask.
    Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s