If your pages does not fit into these layouts, then you have to go for "Custom page layouts".
By default, WSS wont allow you to have any more page layouts other than these out of the box page layouts. There is small tweaks need to be done, in order to accomplish your page layout to get listed in "spcf.aspx" or you can have your own "custspcf.aspx" page which lists your page layouts.
Here is how i did it.
There are three simple steps to be followed. Those are
1. Creating additional layout pages.
2. creating a custom spcf page (which lists out your page layouts.. I will tell you why..you have to go for the custom one here )
3. Adding a link in the create.aspx page ( which directs you to custspcf.aspx page)
1. Creating Additional Page Layouts
For the Demo am copying one of the existing page layouts.
The Page Layouts are located in the drive
"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\STS\DOCTEMP\SMARTPGS"
You can copy one of these and save it as "spstd9" (there are already 8 built in templates in this folder).
The image [This is to show how your page layout looks like] that gets displayed in spcf ( or custspcf.aspx) comes from the "_layouts\images" folder. So you need to store the image corresponding to the page layout in that purticular folder
( Note : "_layouts\images" folder maps to "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\template\images" in IIS).
Important thing here is "The name of the image should be same as the name of the page layout.
Eg if the name of page layout is 'spstd9.aspx' then name of image should be 'spstd9.gif' "
2. Creating a custom spcf page
First lets understand..
why not use the spfc.aspx itself?
The built in spfc.aspx page makes use of "OWSSVR.DLL" which is located in "\12\ISAPI\" folder for its processing. Its shielded to us and hence the functionality cannot be altered...
(Actually, the spfc.aspx passes the parameters to the dll as a query string, may be its possible to achieve the functionality by appropriate query parameter. But, a more research is required here.. May be some one can pen on this).
So.....
lets build Custspfc.aspx page
This application page is give by Microsoft for wss 2.0 and works for wss 3.0 as well.. You can download the page from here.
Open the page and navigate to code snippet
See the option values and if you want to add one more page layout add one more row and give the page layout name as value, and increase the size to 10. That's all, you add as many layout pages as you wish,by this way.
Save the Custspfc.aspx in "_layouts" folder ("C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS")
3. Adding a link in the create.aspx page ( which directs you to custspcf.aspx page)
Now, we have come to the last step .
open the "create.aspx" page from "_layouts" folder. Search for the code
below that add a link to "custspcf.aspx"
This will create a link in your create.aspx page from which you can go to "custspcf.aspx" page.. (http://machinename:port/_layouts/custspcf.aspx)
Thats all.... Go and browse your site and create pages using your own page layouts.
16 comments:
how do u get the spfc page to work without using these custspfc page..
Excelent post, but i would like to use this to add custom webpart pages to a document library.
How do you get this in moss 2007?
This doesn't seem to work completely. I get errors when trying to modify create.aspx and when choosing a template the image splats. Any suggestions??
Nice post,
will you please let us how we can add custom quick launch by default to this template.
i.e. when you create new layout then customize quick launch will appear in new layout
@ Bubba
You don't need to alter anything in the Create.aspx. I just wanted to put a link in this page so as to navigate to that particular application page(custspcf.aspx).
The alternative could be is to create a feature which in turn creates a link in SiteSettings and will help you to navigate to that page.
@bart
Hope i got ur Question :)
Create a Dosument Library and choose the Default template as WebpartPage.
So whenever you choose New option in Document Library that will navigate to "spcf.aspx" page.
Here what we want is to navigate to url "custspcf.aspx" .
So what workaround we can do here is "have a javascript or meta tag" which automatically redirects you to custspcf page.
Just what I needed, thanks!
@bart and raghu
There's a much neater method of achieving this (in WSS at least).
1. Create a new Site Content Type called "Custom Web Part Page" which has "Web Part Page" as its parent.
2. Edit the "Custom Web Part Page" content type and change the url of the document template to "/_layouts/custspcf.aspx" (advanced settings).
3. Add the "Custom Web Part Page" content type to the document library and set as default. You may need to turn content type management on for the list beforehand.
Now "Custom Web Part Page" will be on the "New" menu and will create new web part pages from the customised custspcf.aspx
@Grims
Thanks Grim, The method which you suggested is the proper way.
using the approach that was mentioned by you, How can we enforce the changes to be applied in the child pages?
Is there a way to do that in WSS?
Thanks
Great Post, much better than the MS instructions (which they've pulled down :)
This page actually has the custspcf.aspx code...
http://www.mindsharpblogs.com/PaulS/archive/2008/08/19/7488.aspx
You might still look at the google cache for the original MSDN page...
http://74.125.77.132/search?q=cache:LSPN4h6AEF0J:msdn.microsoft.com/en-us/library/ms916835.aspx+http://msdn.microsoft.com/en-us/library/ms916835.aspx&cd=1&hl=en&ct=clnk&client=firefox-a
When i try to create a page based on my Custom layout (which is a copy of one of the existing page layouts) it gives me an error.
Invalid URL Parameter
The URL provided contains an invalid Command or Value. Please check the URL again.
Hi, and tanks for this good post.
I've the same problem as Fijaz - Any idea ? Fijaz, have you find a solution ?
I can't download the Custspfc.aspx page. please can you provide us with a link..
Thanks for your time...
Many institutions limit access to their online information. Making this information available will be an asset to all.
Nice article, i appreciate for putting this together! "This is obviously one great post. Thanks for the valuable information and insights you have so provided here. Keep it up!"
Marketing Dissertation
Nice article, i appreciate for putting this together! "This is obviously one great post. Thanks for the valuable information and insights you have so provided here. Keep it up!"
Marketing Dissertation
Post a Comment