.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to Provision Javascript In site definition?

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :SharePoint
How to Provision Javascript In site definition??

View Complete Post

More Related Resource Links

How to provision a WIKI site as a sub site in a custom Site definition?


Hi all,

I have a custom Site definition which is made up of team Site Template(STS). In that I have populated lists and content types according to my requirement. Now I need to provision a WIKI site as a sub site in that Definition. I have used Provision data attribute of Configuration element in webtemp file and defined structure for it. But my site is not being created. The same approach is working with default Publishing sites provided by MOSS 2007(Publishing and collaboration Portals). I suspect that Publishing feature needs to be activated in my template before using provisioning attribute. Is that true. If yes please throw some light on that process. if no, guide me through the next possible solution.


Set Site Icon in Site Definition

Hi,I am trying to set the default Site Icon in my custom site definition.I have changed the titlegraphic.gif in my master page to a new name but that didn't work.In the site definition I have also set the SiteLogoUrl to an image, but that didn't work either.Some people suggest that you should replace the default titlegraphic.gif file with your own image and give it the same name, but I don't see how this could be any good since an update to the sharepoint installation might just overwrite the image again with the default one.Any help would be appreciated!Thanks

javascript not working in iframe on remote site

<html> <body style="background-color: White;"> <form name="ctl01" method="post" action="adv_links_addbycustomer.aspx" id="ctl01"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/</div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/dfdafa" /> </div> <div style="background-color:White;"> <span id="lblMsg" class="ErrorText" style="font-weight:bold;"></span> <center> <span id="Label1" style="font-size:X-Small;font-weight:bold;">Valid Urls</span> <select name="DropDownList1" id="DropDownList1" style="background-color:#EFEFEF;border-color:#898989;border-width:1px;border-style:Solid;font-size:8pt;padding:0px;"> <option value="0"> - Select - </option> <option value="http://www.fha-home-loans.us/index.htm">http://www.fha-home-loans.us/index.htm</option> <option value="http://www.fha-home-loans.us/jumbomortgage/apply.htm">http://www.fha-home-loans.us/jumbomortgage/apply.htm</op

Creating a new root Site Collection using a custom site definition file (ONET.XML)

Using Powershell, I am trying to deploy the our custom solution to SP 2010.  The script is doing the following: Deleting the web application using Remove-SPWebApplication Creating a new web application using New-SPWebApplication Adding and deploying a series of WSP files (one of which has the site definition file in it) using Add-SPSolution and Install-SPSolution Create a root site collection based on the site definition file provided in the WSPs using New-SPSite I get the error "WARNING: Template is not found and is not applied." When I run Get-SPWebTemplate, my site definition does not show up. I saw this: http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5ea46e07-a4b0-4bab-b698-9b6eeb695607 but I want a solution that does not involve me reloading a DLL, as, I feel there is something else I am forgetting. I have also tried: IISReset Resetting the timer service Cleaning the Cache (as described here: http://support.microsoft.com/kb/939308) Nothing seems to work.  Does anyone have any ideas?

Deploying custom 2007 site definition to 2010

For a customer I am upgrading their SharePoint 2007 enviroment to SharePoint 2010. After a succesfull upgrade I am stuck with one last annoying problem: when creating a publishing site collection using a custom definition the provisioning of the site definition  fails. Interesting about this is that the provisioning works from the central admin UI, but this customer has an custom webpart for creating site collections in a web application outside of Central administration. The simplified code for this is: public static bool Create(SPWebApplication webApp, string Url, string siteTitle, string siteDescription, uint lcid, string siteTemplate, string ownerLogin, string ownerName, string ownerEmail)         { SPSite site = null; try { SPSite newSiteCollection = webApp.Sites.Add(Url, siteTitle, siteDescription, lcid, siteTemplate, ownerLogin, ownerName, ownerEmail); newSiteCollection.Close(); newSiteCollection.Dispose(); site = GetRootSite(webApp); bool r = (site != null) ? true : false; return r; } catch { return false; } finally { if (site != null) site.Dispose(); }         } The exception is thrown when webApp.Sites.Add() is executed. The user we are logged in as, as wel the appID, are Farm Admin's. The ULS shows this exception: Exception thrown while fetching field by internal name 'Wiki_x0020_Page_x0020

How to decide whne we should use site definition or site template?

What is the difference between site definition and site template and whne do use site definition and site template?

feature stapling done against site definition breaks when saving site as a template?

Hi, we have a bunch of feature stapling done against some of our site definitions on a solution we are working on. This feature staple has a bunch of feature dependancies which all work in a variety of ways. One of these dependancies then uses a feature receiver class to do some post provisioning setting up of web part connections and the like. This all works very well when creating a new site from a site definition etc etc. The problem arises when a user opts to provision a site in this way, and then uses the 'save as template' function within sharepoint. (BTW this is WSS 3.0 / MOSS). The site template saves correctly, but now the feature receiver never runs. I'm assuming this is because the associated feature staple doesnt run either? I've looked around and seen some reference to feature stapling not working against templates. Is this true? 

Packaging Site Definition

Hi All, I need some guidance in how to generate a WSP for custom site definition. I will be migrating site definition from SP 2007 to SP 2010. So far, I have been doing the manual copying for deployment. However, I would like to package everything into WSP so that I can migrate it to 2010 smoothly. I have webtemp files, features, DLLs, CSS files, etc.. Can someone point me to a resource on where to start? Thanks!

Running code after site definition site creation in a event receiver or feature receiver

Hi guys I've got a site definition which is pretty much based on STS.This is it's own sharepoint project. Let's call this project SiteDefProj. Next in another SharePoint project (same solution though). Let's call this CustomListProject. In this project I've got a feature which provisions a bunch of lists based on custom content types - this feature is a site scoped. Let's call this feature: CustomListInstances. I have added a feature receiver to this feature to execute some custom code on the lists themselves (under feature activated) In my ONET.XML (part of the SiteDefProj) I have CustomListInstances feature ID as part of my <sitefeatures>. When I do a create site I can actually step through the code and see it actually being executed but after the site is created the list instances are created but it's like the code never run or did anything. The weird part is that stepping through the code while creating a site collection using my SiteDefProj the code runs great with no errors. All lists are there and the code runs smooth. If I manually create a STS site and activate my feature everything works and the code does actually run and the effects are visible after the feature is created. Again I can actually step through it in debug. My suspicion is that there's some sort of a race condition in the CREATE SITE functionality where maybe the web or site collection hol

SharePoint how does it know to use a feature default.aspx deployed instead of site definition defaul

I have created a feature which deploys a custom default.aspx page. The deployed file goes to the template\features{featureName} directory. How does SharePoint know to use this default.aspx page instead of the one that is located in SiteTemplates{Site Def name} directory?dave

where to specify the master page in site definition?




There are two site definition created. and two master pages for each.

Now when user creates new site definition the respective master pages should be applied automaticaly.

what needs to be done?

What to do if particular site definition should be appeared at particular subsite level only?


What to do if particular site definition should  be  appeared at  particular subsite level only?


Reg: Does Custom site definition created in SharePoint 2007 works in Sharepoint 2010



If one has created a custom site definition in sharepoint 2007, Once the whole site is migrated to sharePoint 2010 will that "custom site definition" created in 2007 will work without breaking in SharePoint 2010?

If No, what has to be done to make it work on 2010.






Using ScriptSrc to reference a javascript on publishing site breaks the Asset Picker dialog?


I'm using a site scoped feature to add a reference to jquery.js:


After activating the feature for a publishing site I no longer can insert a picture from Sharepoint. The Asset Picker dialog throws a script error when I select an image:

Line: 3377
Char: 5
Error: 'style' is null or not an object'
Code: 0
Url: http://www.mysitename.com/_layouts/1033/cmssitemanager.js 

My workaround is to add the .js reference directly in the masterpage instead, that does not affect the Asset picker. The error is easilly reproduced on my development server + a production server. I'm hoping anyone else has solved the issue because I would really like to use the cool ScriptSrc also for publishing sites.


how to create a site definition from existing site in sharepoint

Hi any one please help me how to create a site definition from existing site in sharepoint. It's very urgent

Thanx in Advanced



custom publishing site definition


What to do , so that  custom   site definition tab  should appear at site collection level only?

What to do , so that  custom   site definition tab  should appear at subsite level only?

what to do , so that particular site definition tab should not appear at particular subsite level at all.

Feature association in site definition( for site and subsite)



in Onet.xml

one configuration --Template  --is for Site collection site definition
second configuration --Template --is for subsite  site definition

when subsite is created with second configuration  receiver Feature
should be activated
I have associated feature  as

<!-- BascBrandGroup -->

FeatureSiteTemplateAssociation Id="AE6860A5-B140-47BB-8FF4-D971FB93D682"

Feature Id and template name is verified.
but feature is not getting activated.

Please suggest better approaches or if sample code for site collection
site def and ( site and subsite) def is available ,pls provide the link

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend