Here are some examples of managed properties that are available in MOSS 2007,
- AssignedTo
- Author
- ContentType
- FileExtension
- SiteTitle
- etc..
Getting a copy of the page layout
1. Better is to go to the site collection you're starting with2. Select "Site Actions" -> "Site Settings" -> "Modify All Site Settings"3. Under "Galleries", select "Master pages and page layouts"4. Find the page layout from the list and open its context menu, select "Send to" -> "Download a Copy"5. Save the file to the solution location. We won't be using Visual Studio because its not necessary for this evolution.6. Once the file is saved, reopen the context menu for the page layout file and select "View Properties".7. Click on the Preview Image and when it appears, right click and save the image to the same location as the aspx file.
IMPORTANT NOTE: If you are like me, you have a desire to 'clean up' the file declarations so you can see what's going on. Don't do this. I haven't figured out why but when I introduced hard returns in the second line (the really long one) of declarations between <% %> sections, it bombed when I reimported it into SharePoint. A guy on the team here thinks there may be a checksum on that line to head off tampering. Dunno but I know when I leave it it works, when I touch it it bombs.
Now we need to set up the feature to deploy it.
1. Create two new files in any editor: "feature.xml" and "layoutfiles.xml"2. Here are the contents of my feature.xml file:<Feature Id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Title="Custom Formatted Search Page Layout by Jim"
Description="Search page with customized style inclusions"
Version="1.0.0.0"
Scope="Site"
Hidden="FALSE"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="layoutfiles.xml"/>
</ElementManifests>
</Feature>2.1. Id is a new GUID you generate from Visual Studio.2.2. Scope means the level where this will be used, not the level at which it becomes available for items below it. So "Site" scope means it will be installed at the site collection level and used at the site level.3. Here are the contents of my layoutfiles.xml file:<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="CustomSearchMain" Url="_catalogs/masterpage" Path="" RootWebOnly="TRUE">
<File Url="CustomFormattedSearch.aspx" Type="GhostableInLibrary">
<Property Name="Title" Value="$Resources:spscore,SearchMainTitle;" />
<Property Name="MasterPageDescription" Value="$Resources:spscore,SearchMainDescription;" />
<Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
<Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_welcomepage_name#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390064DEA0F50FC8C147B0B6EA0636C4A7D4;#" />
<Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/Preview Images/customsearchpage.gif, ~SiteCollection/_catalogs/masterpage/Preview Images/customsearchpage.gif" />
<AllUsersWebPart WebPartZoneID="TopZone" WebPartOrder="1">
<![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.Portal.WebControls.SearchBoxEx</TypeName>
<Title>$Resources:spscore,SearchBoxWP_Title;</Title>
<Description>$Resources:spscore,SearchBoxWP_Desc;</Description>
<FrameType>None</FrameType>
<AllowMinimize>true</AllowMinimize>
<AllowRemove>true</AllowRemove>
<IsVisible>true</IsVisible>
<Width>420px</Width>
<GoImageUrl xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearch.gif</GoImageUrl>
<GoImageUrlRTL xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/goRTL.gif</GoImageUrlRTL>
<GoImageActiveUrl xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearch.gif</GoImageActiveUrl>
<GoImageActiveUrlRTL xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/goRTL.gif</GoImageActiveUrlRTL>
<TextBoxWidth xmlns="urn:schemas-microsoft-com:SearchBoxEx">280</TextBoxWidth>
<SearchResultPageURL xmlns="urn:schemas-microsoft-com:SearchBoxEx">results.aspx</SearchResultPageURL>
<AdvancedSearchPageURL xmlns="urn:schemas-microsoft-com:SearchBoxEx">~Site/$Resources:cmscore,List_Pages_UrlName;/advanced.aspx</AdvancedSearchPageURL>
<ShowAdvancedSearch xmlns="urn:schemas-microsoft-com:SearchBoxEx">true</ShowAdvancedSearch>
<DropDownMode xmlns="urn:schemas-microsoft-com:SearchBoxEx">HideScopeDD</DropDownMode>
<ShouldTakeFocusIfEmpty xmlns="urn:schemas-microsoft-com:SearchBoxEx">true</ShouldTakeFocusIfEmpty>
</WebPart>
]]>
</AllUsersWebPart>
</File>
</Module>
<Module Name="LayoutPreviewImages" Url="_catalogs/masterpage/Preview Images" Path="Images" RootWebOnly="TRUE">
<File Url="customsearchpage.gif" Type="GhostableInLibrary"/>
</Module>
</Elements>3.1. I took most of this from a coleague and from the net. The CData portion gives you the embedded web part already in the top web part zone.3.2. Notice the gif image parts of the xml. These are whatever the new name is for the gif you edited earlier.3.3. Notice also the part that says: "contenttype_welcomepage_name". This means that your layout will appear under the "Welcome Page" templates when you go to use it in your site collection. I haven't found much about this on the web yet but I believe if you search on content types and master page libraries, you may find additional options.
Now its time to deploy.
1. Copy your aspx, gif (in its folder) and 2 xml files to the server where you want to deploy and into a new temporary folder.2. Copy from the temp location to the 12 hive \Template\Features\ folder.3. Open a command line and run: stsadm.exe -o installfeature -name MyNewPageLayoutFeature -force3.1. Use the -force option if you've already installed previously.3.2. the -name value is the name of the folder where the your feature now exists in the 12 hive.4. Execute iisreset5. Browse the the appropriate site collection on your server and back to "Site Actions" -> "Site Settings" -> "Modify All Site Settings"6. Under "Site Collection Administration" select "Site Collection Features"7. You should see your new feature/page layout. Click to activate.
SharePoint - Cannot convert a primitive value to the expected type 'Edm.Double'. See the inner exception for more details If y...