views:

549

answers:

2

We use the SharePoint 2007 wiki, and I'd like to embed the contents of a wiki page onto our SharePoint Site's Default.aspx.

There is a 'Page Viewer Web Part'. This can create an IFRAME which you can point at any URL... including the wiki page... but that includes tons of navigation bars and chrome. I'm hoping there's a way to strip the nav bars out of the page when rendered in this IFRAME.

Googling has found other people asking this question... with no answers that help me, e.g. http://social.technet.microsoft.com/Forums/en-US/sharepointsocialcomputing/thread/f5cd69a4-ea71-48d9-a607-69341e80fe10

Appreciate if anyone can help? Note that I am a peon developer; I have Full Control over this one SharePoint site but no broader access to the server it's running on.

A: 

[I have to run so I cannot verify my suggestion below. I can do it later if you cannot get it to work for yourself.]

  1. Open an existing Wiki page in SharePoint Designer 2007 (free download if you don't already have it installed).
  2. Switch to the code view
  3. Copy the parts you need (look for ContentPlaceHolderId="PlaceHolderMain") into your page viewer web part (or alternative that allows you to display asp.net markup).

Update: Turns out that the markup of the wiki page content is indexed in the content database by page name, so I doubt that this approach will work.

Philipp Schmid
Thanks Philipp, can't download it right now, but do I take it this would be a static copy of the wiki page? Ideally I was hoping to embed the page such that it would reflect future edits on the wiki.
Iain
No. the page doesn't contain the content of the wiki page, but rather a control which retrieves the contents of the page at runtime!
Philipp Schmid
Correction, while the statement above is true, it seems that the content is stored in the content database by page name, so embedding the controls in Default.aspx won't work. Can you write server-side code? If so, you can retrieve the markup for that page programmatically from content database. Not sure about editing though.
Philipp Schmid
Nah, I can't write server-side code unfortunately. A shame that MS didn't think of this scenario...Thanks for looking at this question. I guess I'll just make a static copy of the content.
Iain
In this case you could load the page into an IFRAME and then write some Javascript code that hides (style.visibility = hidden) the parts of the page you don't want to show. Would that be possible? Most of the controls on that page should have either predictable IDs or can be navigated to in the HTML DOM.
Philipp Schmid
A: 

Since the content of the SharePoint Wiki page is indexed in the content database by page name, simple re-hosting the content is probably not possible.

Therefore, a more feasible approach would be to load the wiki page into an IFRAME and then using Javascript code to modify the properties of the controls you want to 'hide' by either setting their visibility to hidden or their width/height to 0. Not as elegant or efficient, but it will do the trick.

Note: use the Developer Tools in IE8 (or something equivalent) to inspect the live HTML DOM of your page and experiment with modifying the attributes.

Philipp Schmid
Thanks - I will give that a try!
Iain