OK, a very long description for a problem that I ran into when adding new Page Layouts for Custom Content Types via the SharePoint UI. The problem is that Site Columns do not become available for you when you try to customize the Page Layout with SharePoint Designer, if it was added via the UI. Here's the steps to recreate and work around the issue:
- Create a new Site Column.
- Create a new Site Content Type.
- Make the new Content Type available.
- Create the new Page Layout for the new Site Content Type.
- Navigate to SA/SS/MASS.
- Under the Galleries section, click the "Master pages and page layouts" link.
- Drop down the New menu in the menu bar.
- Click the "Page Layout" option on the popup menu.
- The Content Type Group should default to "Page Layout Content Types". If it does not, set it to this value as we created the new Content Type as a child of Page Layouts.
- Drop down the Content Type Name and select your new Content Type, in our example it is "TestContentType".
- In the URL Name field, enter the URL you wish to use for the Page Layout.
- In the Title field, enter the Title you wish to use for the Page Layout.
- Click the "OK" button to add the new Page Layout.
- The new Page Layout should now show up in the list.
- Edit the new Page Layout in SharePoint Designer.
- Open SPD and open your portal.
- In the Folder List, expand the web site item.
- Expand the "_catalogs" item.
- Expand the "masterpage" item.
- Locate your new Page Layout file. It should already be checked out since we just created it and SharePoint by default would create the new file in checked out mode. You can tell that it's checked out by the green check mark () before the file name.
- We now want to add some Site Columns to our new Page Layout. If you look at the code view window of the Page Layout, we'd want to add these fields inside the "PlaceHolderMain" content tag between lines 6 and 7.
- After positioning the curser at the beginning of line 6, we want to add a Content Field.
- In the Toolbox toolbar/pane, scroll all the way down to the bottom of the list and locate the Content Fields section.
- BUG: We do not get any fields that we can add in this section. Instead, we get an error message stating "An error occurred while downloading the Toolbox information."
- If you click the "Refresh" link, you are just presented with an error dialog window stating "The server could not complete your request. Contact your Internet service provider or Web server administrator to make sure that the server has the FrontPage Server Extensions or SharePoint Services installed."
- At this point you're thinking that just maybe you need to publish the new Page Layout before it becomes available.
- So we right click the Page Layout file in the Folder List and click "Check In" in the drop down menu.
- We then select the "Publish a major version" option and click "OK" to publish the new Page Layout.
- You'll now be presented with an error message stating "Cannot perform this operation. The file is no longer checked out or has been deleted."
- Basically, there is no way to get valid Page Fields to be available to this Page Layout because it was added via the UI. In order to work around this BUG, we need to add the Page Layout from SPD Go ahead and delete the Page Layout by right clicking on it and selecting "Delete" on the popup menu.
- Add the Page Layout from SharePoint Designer.
- If you have not done so ensure that the Page Layout file does not already exists and then open SPD and open your portal.
- In the Folder List, expand the web site item.
- Expand the "_catalogs" item.
- Expand the "masterpage" item.
- Right click the "masterpage" folder.
- On the popup menu, hover over the "New" option until it expands a second level popup.
- On the second level popup menu, click the "SharePoint Content" option.
- On the New dialog window, Select the "SharePoint Publishing" option.
- In the 2nd column, select the "Page Layout" option, if it is not already selected by default.
- Leave the Content Type Group set to "Page Layout Content Types".
- Drop down the Content Type Name dropdown list and select your new Content Type, "TestContentType" in our example.
- In the URL Name field, enter the URL value you wish to use for this Page Layout. In our example, we're using "TestPageLayout".
- In the Title field, enter the Title you wish to use for this Page Layout.
- Click the "OK" button to add the Page Layout.
- SPD will load a new instance of itself and load the new Page Layout in edit mode for you. If you now look at the Content Fields and Page Fields sections in the Toolbox tool pane, you'll notice that the fields are now available for you to add to you Page Layout.
Later
C
C
No comments:
Post a Comment
Comments are moderated only for the purpose of keeping pesky spammers at bay.