Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Add webpart to multiple pages

  Asked By: Eliseo    Date: Oct 03    Category: Sharepoint    Views: 2505

How do I add a webpart to all wiki pages, so it is displayed when new
wikipages are created also?

Share: 

 

7 Answers Found

 
Answer #1    Answered By: Ramona Solis     Answered On: Oct 03

Apparently you have to go to the 12 hive to do this, so I'd be a bit
apprehensive (i.e. save a copy first):

C:\Program Files\Common Files\Microsoft Shared\web server
extensions\12\TEMPLATE\DocumentTemplates\wkpstd.aspx

Of course I'd be happy to be proven wrong.

 
Answer #2    Answered By: Harvey Blankenship     Answered On: Oct 03

You do need to do it in the 12 hive, but you could also add  a webpart  to the
default WIKIpage by editing the wiki  page site definition (not recommended) or
by stapling a Module Feature to the existing Wiki page site definition that adds
a web part to the default wiki page. Stapling a feature would be the way I
would try to do this since that is a supported practice. Editing existing files
isn't.

 
Answer #3    Answered By: Xiomara Blanchard     Answered On: Oct 03

Another way is to customize the LAYOUTS\CreateWebPage.aspx as explained in this
blog:
www.sharepointblogs.com/.../sharepoint-wiki-create\
-pages-based-on-a-template.aspx
You can add  webparts to a wikipage and do a whole lot more.

As mentioned, you'll want to create a custom site definition so that the Wiki
Pages list does not refer to LAYOUTS\CreateWebPage.aspx

 
Answer #4    Answered By: Rosemarie Cervantes     Answered On: Oct 03

Thank you for the recommendation to use feature stapling. I have tried
it now but still no luck with webpart  showing up on all wiki pages  so
far.

I have a feature "TestWebpart" with this feature.xml:

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/"
Id="CD3E7788-D354-4c06-A9D3-9BE905D07CF5"
Title="TestWebpart"
Description="My test webpart" Scope="Site"
Hidden="FALSE"
Version="1.0.0.0">
<ElementManifests>
<ElementManifest Location="elements.xml" />
<ElementFile Location="TestWebpart.dwp" />
</ElementManifests>
</Feature>

I've installed this feature and the webpart works fine on the wikipages
when I add  the webpart manually.

Now I try to staple the feature above onto template WIKI#0 using a
feature.xml and elements.xml in directory TestWebpartStapled. My
understanding is I should use the same Id in the stapled elements.xml as
my non-stapled feature above.

The TestWebpartStapled feature deploys and activates, but the webpart
from above is not showing on wiki  pages after an iisreset also.

Am I missing something in the feature stapling here, please?

stapled feature.xml:

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="79F23FC4-D9AD-4ec8-B210-E0272964D8D8"
Title="TestWebpartStapled"
Description="TestWebpartStapled"
Version="1.0.0.0"
Scope="Site"
xmlns="http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/"
DefaultResourceFile="_Res">
<ElementManifests>
<ElementManifest Location="elements.xml"/>
</ElementManifests>
</Feature>

elements.xml:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/">
<FeatureSiteTemplateAssociation
Id="CD3E7788-D354-4c06-A9D3-9BE905D07CF5" TemplateName="WIKI#0" />
</Elements>

 
Answer #5    Answered By: Manan Kadu     Answered On: Oct 03

What does your elements.xml for the feature "TestWebpart" look like?

 
Answer #6    Answered By: Tonia Franco     Answered On: Oct 03

My elements.xml for TestWebpart looks like this:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="WebParts" List="113" Url="_catalogs/wp" >
<File Url="Svarstjansten.dwp" Type="GhostableInLibrary" />
</Module>
</Elements>

 
Answer #7    Answered By: Amareswar Karkera     Answered On: Oct 03

I believe that you will have to use feature stapling for this.

 
Didn't find what you were looking for? Find more on Add webpart to multiple pages Or get search suggestion and latest updates.




Tagged: