Adding a sharepoint webpage without storing it in a document library? - sharepoint

I want to do something very simple: Add a "Basic page" to a sharepoint site, and have it appear in the quick launch side navigation. But it insists on storing it in a document library. Is there anyway to not store it in a document library?

You can add the page to the site as a module.
The following XML is how you can register the module for use with SharePoint:
<?xml version="1.0" encoding="utf-8" ?>
<Elements
Id="<GUID />"
xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="<Name />" >
<File Path="<Feature Sub-Directory />"
Url="<URL on SharePoint site />"
/>
</Module>
</Elements>
To get the navigation working use a feature receiver. This is a good place to start for modifying the navigation programmatically: http://msdn.microsoft.com/en-us/library/ms558975.aspx

Related

Sharepoint Online Edit Form Toolbar

I'm trying to create a custom action on the edit form on Sharepoint Online with a Sharepoint Add-in..
According to the documentation, I should be able to use EditFormToolbar location as follows:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="965225e0-662b-4089-acdc-78433528f646.TestMenuAction"
RegistrationType="List"
RegistrationId="{$ListId:Lists/Add-in List Test;}"
Location="EditFormToolbar"
Sequence="10"
Title="Test Button">
<!--
Update the Url below to the page you want the custom action to use.
Start the URL with the token ~remoteAppUrl if the page is in the
associated web project, use ~appWebUrl if page is in the app project.
-->
<UrlAction Url="~appWebUrl/Pages/LookupWebPart.aspx?{StandardTokens}&SPListItemId={ItemId}&SPListId={ListId}" />
</CustomAction>
</Elements>
But this fails to deploy with the following error:
#"Error 1
CorrelationId: 817f7325-e9bc-41da-ae9f-400b459ce1cf
ErrorDetail: There were problems with the app web definition in the package.
ErrorType: App
ErrorTypeName: App Related
ExceptionMessage: Deployment failed in host web https://<redacted>.sharepoint.com/sites/dev.addin for app <redacted>/ca27c77f-c56f-409d-a69d-7064091fdda4. Microsoft.SharePoint.SPException: Feature definition with Id ca27c77f-c56f-409d-a69d-7064091fdda5 failed validation, file '/elements33b5f3d1-0607-455b-b292-880b39ec127d.xml', line 6, character 17: The 'Location' attribute is invalid - The value 'NewFormToolbar' is invalid according to its datatype 'http://schemas.microsoft.com/sharepoint/:CustomActionLocations' - The Enumeration constraint failed.
The schema documentation instead suggests that only CommandUI.Ribbon and EditControlBlock are supported locations.
Does anyone know if it's possible to customise the Edit Toolbar in Sharepoint Online?

SharePoint hosted app custom list form upgrade

I created a SharePoint Hosted add-in with custom list form as directed in
https://blogs.msdn.microsoft.com/wilsonreddygajarla/2014/12/13/sharepoint-list-newform-customization-in-sharepoint-hosted-app/
All, works great until you want to upgrade the add-in with changes to your custom form. I have tried the following approaches:
Created a module entry within the list element.xml with ReplaceContent=True which deploys successfully but does not replace the form with new changes.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="CustomList">
<File Url="NewItem.aspx" Path="CustomList/NewItem.aspx" ReplaceContent="TRUE" />
</Module>
<!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List project item, an error will occur when the project is run. -->
<ListTemplate ...`
Tried to reference a custom form page from Pages module but the Path in Schema.xml somehow keeps looking for the custom form within the List Definition folder.

SharePoint 2013 app icon for library template

I created a feature (solution) which deploys a library template for SharePoint 2013. If I use this template to create a new library I go "Settings -> Add an app". There each app has a tile with an icon. Now my question is if I can change this Icon in my List Definition or anywhere else?
you need to use the Image attribute of the ListTemplate
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListTemplate
Name="MyList"
Type="10012"
BaseType="1"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="110"
DisplayName="My List"
Description=""
Hidden="false"
Image="/_layouts/images/itdl.png"
DocumentTemplate="121"/>
</Elements>

How to REpublish Custom Task Forms (InfoPath) to SharePoint 2010 State Machine Workflows

I am new to SharePoint. Sorry if answer to my question is obvious.
I've create Custom Task Form in InfoPath and publish it (File/Publish/Network Location [Form Template Path and filename='MYPROJECT/Forms/ApprovalForm.xsn'; Form template name='ApprovalForm'], in the next window I've cleared Public URL according to the article http://www.codeproject.com/Articles/195348/SharePoint-2010-State-Machine-Workflows-with-Custo).
After it I've added module Forms, and added ApprovalForm.xsn from the existing items.
My xml files:
Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Workflow
Name="Order New Server"
Description="My SharePoint Workflow"
Id="482cbc86-b717-4981-a49a-3cf4c89e9399"
CodeBesideClass="Myproj.OrderNewServer.OrderNewServer"
CodeBesideAssembly="$assemblyname$"
TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160">
<Categories/>
<AssociationData><Data></Data></AssociationData>
<MetaData>
<AssociationCategories>List</AssociationCategories>
<Task2_FormURN>urn:schemas-microsoft-com:office:infopath:ApprovalForm:-myXSD-2012-03-09T14-11-55</Task2_FormURN>
<StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>
</MetaData>
</Workflow>
</Elements>
Feature.Template.xml:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/" ReceiverAssembly="Microsoft.Office.Workflow.Feature, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Receiverlass="Microsoft.Office.Workflow.Feature.WorkflowFeatureReceiver">
<Properties>
<Property Key="GloballyAvailable" Value="true" />
<Property Key="RegisterForms" Value="Forms\*.xsn"/>
</Properties>
</Feature>
My form work fine, but when I make changes and republish it, it doesn't update (I see old form).
What I tryed:
IISReset
Clear all cookies and cache in IE
Retract solution, restart VS2010, reboot computer.
Change assembly number, guid.
I have no ideas, what can I try for republish my form with changes.
Thank you in advance for any suggestions.
PS: sorry for my writing. English is not my native language.
PPS: when I save new Form to new location and add it to the project, it works.
I've found how can I republish changes. But it seems more like crutch than solution, but it works: After republishing InfoPath form, I delete file from project (DEL on ApprovalForm.xsn in Solution explorer) and after it add it again. (Add/Existing Item). And then redeploy! Hurray!

WSS 3.0 Site Definition breaks when including MasterUrl in onet.xml

I have created a simple site definition for WSS 3.0 which uses a feature, this feature provisions a master page into the masterpage gallery.
This works absolutely fine, and once I've created a site from the definition I can go into the masterpage gallery and view my provisioned file.
If, however, I set the MasterUrl in my Configuration node of onet.xml and then create a new site from it, it fails. After clicking create it redirects me to the new site automatically but presents me with a file not found error. So I type in the url to the settings page and click to view the masterpage gallery which then gives me a file not found error again.
I'm not sure what's going on, but it looks to me like setting the MasterUrl prevents it from creating the correct lists to which the feature can provision the masterpage to. Can anyone shed any light on this matter for me please?
Here is the webtemp*.xml:
<?xml version="1.0" encoding="utf-8"?>
<Templates>
<Template Name="MasterPageTest" ID="10902">
<Configuration ID="0"
Title="MasterPageTest"
Description="Testing master page deployment"
Hidden="FALSE"
ImageUrl="/_layouts/images/stsprev.png"
DisplayCategory="Test"
/>
</Template>
</Templates>
And the onet.xml (with the masterurl attribute removed):
<?xml version="1.0"?>
<Project Title="MasterPageTest" Revision="3" ListDir="$Resources:core,lists_Folder;" xmlns:ows="Microsoft SharePoint" xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- _locID#Title="camlidonet1" _locComment="{StringCategory=HTX}" -->
<NavBars>
</NavBars>
<ListTemplates>
</ListTemplates>
<DocumentTemplates>
</DocumentTemplates>
<Configurations>
<Configuration ID="0"
Description="Testing master page deployment"
Title="Master Page Test"
Name="MasterPageTest"
>
<!-- MasterUrl="_catalogs/masterpage/MasterPage.master" -->
<Lists>
</Lists>
<Modules>
</Modules>
<SiteFeatures>
</SiteFeatures>
<WebFeatures>
<!-- Masterpage -->
<Feature ID="8175B375-38F5-44E2-950A-9600D5427E17"/>
</WebFeatures>
</Configuration>
</Configurations>
<Modules>
</Modules>
<ServerEmailFooter>$Resources:ServerEmailFooter;</ServerEmailFooter>
</Project>
My first thought was: Why in the onet.xml?
I usually do this using a process called Feature stapling. It is impossible to remove / disable functionality created from a site definition later on (off course you could by hand, or a feature + receiver to remove say a list you don't need for a particular site created from the onet.xml, but you probably get the point).
By using feature stapling, (your / the) site definition stays clean and stays what it is meant to be: a definition of a site, that can be selected during site creation. IMHO, it should be nothing more than an empty container.
Feature Stapling binds features you want activated when a site is created to a (custom) siteTEMPLATE. You can even use this to attach features you want activated on out of the box site definitions as well. For instance, feature stapling is the preferred way of enabling features in the "MySite" and "My Site Host" definitions. The original sitedefintion remains untouched, but your features are activated too!
Now to actually answer your question: The masterpage is probably not available yet when the site definition is used, the onet.xml is processed before any features are activated.
If your site is a publishing site (meaning the publishing related features are activated in the site collection), you can set the masterpage in the Publishing Feature with the ChromeMasterUrl property.
If the site is a regular site, you can do 2 things:
deploy the master page from the onet.xml by moving the <Module> from your masterpage feature to the onet.xml, more info here (figure 1).
don't set the masterpage url in the onet, but use a feature + featurereceiver to set the masterpage url, more info here (downloadable code in article).

Resources