Archive for May 2007

 
 

SPS2003 Site Template Gallery

As a follow up from our recent discussion about the SPS2003 List Template Gallery, we should look at the SPS2003 Site Template Gallery.

You find it under Site Settings | Manage Security and Addional Settings.  Again, you roll into the gallery and upload your template and viola…

Say you've uploaded your site template.  You should be able to go to the Site Manager area and click on Create Site and select your template.

sigh…

 -robot

SPS2003 List Templates

So, we know that the top level site owns the list template gallery.  Remember also, when the list template gallery is just another doc library so you can right click on a template and save the .stp file to disk. You can also rename the .stp file to .cab and then open it like any .cab file to see that there's a manifest.xml  in there and it will define the content and structure of the list.

But also, the portal has its own list template gallery.  Find it under Site Settings | Manage Security and Addional Settings.  so you roll into the gallery and upload your template and viola…

I guess it was too good to be true,  when you go to create a new list in a portal area, you don't get the option to use your list template. 

Is this supposed to work?  Does anybody know?

Well sure, you say…  The Create ListLibrary list is trimmed to templates in the gallery that are cut from sites with the same site type.  That is to say, if you create a doc library in a team site and cut a template from it, when you upload the template to a meeting site's list template gallery and click create, your template will not be an option.  Likewise, the various portal areas are individual site types; if you cut a template from the home area and upload it to the portal's list template gallery, you won't be able to use that template in any area that doesn't use the home template.

At least it's good to know.

The question remains, however, what does the portal site template gallery do?

-robot

Create Your Own Context Menu

You remember we talked once about getting documents to open into work in such a way that when you save it, it saves straight back the to document library.

We had this post where I reviewed the html that opens documents from the context menu in a document library.

Well, our new best friend Pedro give us this gem:

http://pserrano.blogscavedigital.com/PermaLink,guid,82933a22-3179-48a0-bfef-15b8a6744b25.aspx

Where he shows us how to completely steal the context menu code.

My current objecttive revolves around this solution:  I want a site owner to be able to edit a "Current Status" page in MSWord and then use that document as a source for a content editor web part.

And this works great; you should try this.  Assume you have a new blank site.

First create a document library using the default MSWord document as a template.  Create a document and call it SiteUpdate.htm.  Be sure to use the .htm extension when you save it.

Next, create a web part page.  Call it Update.aspx and put a content editor web part on it.  Put the URL to your SiteUpdate.htm in the Content Link field.

Then, in a second content editor web part use Pedro's code like this:

 <SCRIPT>
myCtx = new ContextInfo();
myCtx.listBaseType = 1;
myCtx.listTemplate = 101;
myCtx.listName = "{<put list GUID here>}";
myCtx.listUrlDir = "Document Library";
myCtx.HttpPath = "http://MyPortal/Resources/_vti_bin/owssvr.dll?CS=109";
myCtx.HttpRoot = "http://MyPortal/Resources";
myCtx.imagesPath = "/_layouts/images/";
myCtx.PortalUrl = "/";
if (myCtx.PortalUrl == "") myCtx.PortalUrl = null;
myCtx.displayFormUrl = "http://MyPortal/sites/MySIte/MyDocLibrary/Forms/DispForm.aspx";
myCtx.editFormUrl = "http://MyPortal/sites/MySite/MyDocLibrary/Forms/EditForm.aspx";
myCtx.isWebEditorPreview = 0;
myCtx.ctxId = 1;
myCtx1 = myCtx;
</SCRIPT>

<!– my item: BEGIN –>
<table
height="100%"
cellspacing=0
class="ms-unselectedtitle"
onmouseover="OnItem(this)"
CTXName="myCtx1"
ItemId="1"
ServerUrl="/sites/MySite/MyDocLibrary/SiteUpdate.htm"
FileDirRef="sites/MySite/MyDocLibrary"
HTMLType="Word.Document"
FileType="htm"
DocIcon="icxddoc.gif|Microsoft Office Word|SharePoint.OpenDocuments"
FSObjType="0"
COUId=""
SourceUrl="">
<tr>
<td width="100%" Class="ms-vb">
<A onfocus="OnLink(this)" HREF="http://MyPortal/sites/MySite/MyDocLibrary/SiteUpdate.htm" onclick="DispDocItemEx(this,'FALSE','FALSE','FALSE','')">
Manage Update Content
</A>
</td>
<td><img src="/_layouts/images/blank.gif" width=13 style="visibility: hidden" alt="">
</td>
</tr>
</table>
<!– my item: END –>

What you end up with is content on your page that can be edited in MS Word using the options provided by the context menu.

Mine is a little different from Pedro's; he was trying to run an InfoPath form.  Now, you can give the site owner edit access to the document libary and he or she can modify the update content in Word, click save and the content will be written right out to the web part page via the first content editor.

Groovy, no?

-robot