Create list in existing site collection from a feature - sharepoint

I have created a feature, a publishing site, in Visual Studio to MOSS - this feature contains a masterpage, some page-templates, some site columns (grouped to match each page-template) and som custom list templates etc. I have also created a site collection, some sites and pages based on my feature.
Now I have upgraded the code in my feature - I wanted a ListInstance to be created based on my custom list template. When I have upgraded my SharePoint (using WSPBuilder), the ListInstance and default data are visible if I create a new site collection, but existing site collection does not get the ListInstance and data. Is there anything I can do to update existing site collections to contain the ListInstance when upgrading?

Unfortunately your only choice here is to programmatically create the list in all existing sites in the feature's FeatureActivated method in a feature event receiver. This is a gaping hole in sharepoint's deployment model, and a painful one at that.
-Oisin

Related

Creating subsites in Sharepoint Online on a Site generated by a Teams team

I want to create a Subsite in Sharepoint Online within a site that was automatically generated via a MS Teams team but the option to do so doesnt exist.
The option to create Subsite seems to ONLY exist if a Site was created from within Sharepoint Online.
I can understand that a workaround would be to create it as another Site within Sharepoint Online and then link the relevant Sites together under a HUB.
Am I missing something or this feature does not exist in Sharepoint Online unless I create the Subsites as Sites and then link them up via a Hub?
Thank you in advance for the help.
There is a setting in the SharePoint Online Admin Center to Hide or Show the create subsites option.
Microsoft is discouraging the use of subsites, and the creation of subsites is likely to continue to be phased out as more features and capabilities are added to Hubs. While there are still exceptions to the rule, since there are still aspects that Hubs cannot accomplish (like connecting Hubs together to a parent Hub), you should seriously consider building your solution to use separate site collections.
Depending on how the rest of your SharePoint environment is architected, a better approach would be to setup that team site as a hubsite, then create the additional site collections you need, and link it to the new hubsite. This way you kind of mimic the subsite structure ( but not all its features ) while preserving every site independent.
For more information on best practices on SharePoint site Architecture, see https://learn.microsoft.com/en-us/sharepoint/information-architecture-modern-experience.

Not able to create site using site template - SharePoint 2013

I have created SharePoint Site, from which I created a site template, now I need to create similar sites under same site collection using the Site Template. In order to automate this functionality I created the Site Template and try to create new sites from this template using SharePoint Designer Workflow using web services. But while performing this am getting below error.
"The site template requires that the Feature {bf8b58f5-ebae-4a70-9848-622beaaf2043} be installed in the farm or site collection"
To troubleshoot this issue I tried to create the site using the same site template manually, which am able to perform successfully.
I found that above GUID {bf8b58f5-ebae-4a70-9848-622beaaf2043} refers to Power View feature, which I found activated in my site collection, But am not using any power view related functionality in my application.
I would be grateful, if anyone let me know how to resolve this issue.
It seems like the issue is with the template. That error is saying before you create the site template, enable that feature at the site level on the template site before saving the site as a template. I had a similar use case about a year ago to automate all our private team site creation. I found this article very useful.
https://sharepointryan.com/2013/09/10/create-a-sharepoint-site-spweb-using-rest-in-spd-2013-workflow/
In the dictionary for the json request, set WebTemplate to the template / solution ID from your site collection.
Hope it helps.

How to force users to use specific custom template for meeting workspaces?

I have a calendar on a SharePoint 2010 site and I have created a custom site template based on the standard meeting workspace. I'd like to force users to only be able to use my custom template.
One option is to add Hidden="TRUE" in webtemp.xml for all other meeting workspace templates - this will leave mine as the only option. This, however, works on the farm level and I'd like to keep the templates available for other web applications. If I can do this on a web application or lower level it will do the trick.
Even better solution - if I can make the new event dialogue skip the step altogether and use my template without asking.
Background:
My custom template only contains security customizations, no UI or content changes. I want to impose it as I have requirements for the permissions of the meeting workspaces which are different from the parent site - so inheritance has to be broken. But I can't think of another way to supply default permissions other than by using a site template for the workspace.
Site Settings > Look and Feel > Page Layouts and Site Templates
choose the site templates you want to be used in the site, this can inherit all the way down the site collection or you can start in a subweb.

Site Template and Master pages

I am a .net developer and want to learn SharePoint. Usualy we use MasterPages to have a constant layout for all or some of the pages. My confusion here is SharePoint uses Site Template and MasterPages which both sounds to do same thing. am I right?
thanks
MasterPages and Site templates are absolutelly different thing. Master page is usually layout of some pages. It's same like in ASP.NET.
In Sharepoint you can create some sites in site collection. These sites are created according to site template. When you creating (for example) team site, it's created according to team site template, which is stored in Sharepoint folder on file system. In site templates you can specify which features should be activated when site is created, which features should be activated on site collection scope etc. Also you can specify list, which should be created, modules... And also you can specify default master page which will be used on site.
You can find more informations on msdn

SharePoint and workflows

With MOSS 2007 (the question is probably applicable to WSS as well but I'm working in MOSS at the moment) is it possible to have the same Workflow on every Pages list within the site collection?
We're deploying a site with a basic 2-stage approver workflow so I'm not developing a custom one, just using the existing Approver workflow but having 2 approval groups working sequientially (see this blog post: http://www.sharepointblogs.com/tommysegoro/archive/2008/08/18/configuring-sharepoint-moss-2007-multi-stage-approval-workflows.aspx).
The problem is that when you create a Publishing Site it gets (by default) a single approver workflow, not the one I want.
Can I have the workflow enforced across the site collection and for any child site collections? Or do I need to create my own site template (and can that even define the workflow as it's deployed?)?
Edit
Just to clarify, I'm wanting to have the ability to create a new MOSS publishing site which has some slight modifications to the standard Approver workflow which is out of the box within SharePoint. I'm not wanting to deploy a different workflow, just modify the existing.
When you create a Publishing Site you get a "Parallel Approver" workflow which assigns workflow tasks to a group called Approvers and is set to run the workflow tasks in parallel. I need to change the groups (add a new one) and set it to be sequential.
You can create a feature which will add the second work flow to the Pages library when activated using the SPFeatureReceiver class, and staple that feature to the existing Publishing Site site definition using feature stapling.
Here are MSDN posts on using feature event receivers and feature stapling:
http://msdn.microsoft.com/en-us/library/bb862634.aspx
http://msdn.microsoft.com/en-us/library/bb861862.aspx

Resources