SharePoint 2013 app icon for library template - sharepoint

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>

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.

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!

I've got a sharepoint solution, what next

I'm new to sharepoint. I have a C# solution, that has masterpages and user-controls to be used in a sharepoint site. I have setup my sharepoint dev VM and i can browse the default sharepoint stuff.
How do I add the master pages to Sharepoint? Where do I go from here?
My suggestion would be to deploy the master pages as a feature rather than a manual process. Solutions (WSPs) and Features are the supported way to deploy content/features into sharepoint. A really great tool for sharepoint development is called WSPBuilder
A master page is deployed into sharepoint as a "module" that you will place into your elements.xml file in the feature.
Think of a solution as a .cab file with a different extension. Within that is a file called feature.xml which defines the title of your package when its deployed. Features can be activated and deactivated to deploy and undeploy your content into parts of your farm.
Here is an example of a css file deployed as a Module... Master pages would be similar however, they would deploy into the master page gallery rather than the style library. This module deploys a custom css file into the "Style Library" of a site collection. After this is deployed I used a "Feature Receiver" (event handler) to grab a reference to the SPSite object and modify its alternate stylesheet so that my override took place.
Feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="63BB13A0-1F9C-4c3b-BE60-10E59CEE0113"
Title="Custom CSS Feature"
Description="Deploying a custom CSS using a feature"
Version="1.0.0.0"
Hidden="FALSE"
Scope="Site"
ReceiverAssembly="CustomCSSFeature, Version=1.0.0.0, Culture=neutral, PublicKeyToken=24f1377a8414d2ed"
ReceiverClass="CustomCSSFeature.FeatureReceivers.CustomCSSFeatureReceiver"
>
<ElementManifests>
<ElementManifest Location="elements.xml"/>
</ElementManifests>
</Feature>
elements.xml - you'd modify this to reflect where master pages are supposed to be deployed I would think that this is the Url property. The Path="Styles" refers to the relative path within the feature itself where the style sheet resides (e.g. in your visual studio i have a sub folder called styles beneath the folder called CustomCSSFeature and that is where the style sheet exists)
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="OSGStyles" Url="Style Library" Path="Styles" RootWebOnly="TRUE">
<File Url="custom-css.css" Type="GhostableInLibrary" />
</Module>
</Elements>
Then, in my feature receiver class I have activated/deactivated handlers which "apply" the stylesheet to the publishing web. In your case you can likely change the default master page for the website in a feature receiver as well.
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPSite site = properties.Feature.Parent as SPSite;
using (SPWeb web = site.OpenWeb())
{
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
publishingWeb.AlternateCssUrl.SetValue(web.ServerRelativeUrl +
"/Style Library/custom-css.css", true);
publishingWeb.Update();
web.Update();
}
}
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
SPSite site = properties.Feature.Parent as SPSite;
using (SPWeb web = site.OpenWeb())
{
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
publishingWeb.AlternateCssUrl.SetValue("", true);
publishingWeb.Update();
web.Update();
}
}
Copy them to SharePoint root (For SP 2007 default location is C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\, for SP 2010 instead of "12" you have "SharePointRoot")
From there, copy your files to \TEMPLATE\LAYOUTS folder and then you can reference masterpage from your aspx pages like "/_layouts/mymasterpage.master".
UserControls goes into \TEMPLATE\CONTROLTEMPLATES
Get to know the directory structure in the 12 Hive
Exploring the 12 Hive : TEMPLATE Directory
Another way is to put your masterpage in master pages list. Use this link to access master page list and upload your masterpage: http:///_catalogs/masterpage
You can add master pages using the SharePoint Designer 2007.
Generally i recommend you to take a look at the answers of this question: Learning Sharepoint

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

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

Resources