简体   繁体   中英

SharePoint - Rendering a wiki page without navigation bars

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, eg 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.

I did this: go to all site content, create your Wiki, then copy the URL for it from the address bar, next open the Navigation settings (site settings/all site settings/navigation) then add a new link to the menu, paste your wiki address into the URL window that comes up and add any comments as required, position your wiki link within the menu structure as required and click OK.

Job done, you should have a new page (and tab) which when you click on it, gives you your embedded Wiki.

[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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM