I have a created a SharePoint 2013 document library programmatically within a custom site definition. The problem is that when I browse to the AllItems.aspx of that Doc Library a "new item" button appears instead of "new document" like in OOB document library.
Besides, when I click on "New item" button no action is fired. I'm only able to upload documments throughtout the ribbon or drag and drop function using chrome or firefox.
this is the Elements.xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- 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
Name="ListDefinitionCommunityDocuments"
Type="10000"
BaseType="1"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="110"
DisplayName="$Resources:Intranet,ListDefinition_CommunityDocuments_DisplayName;"
Description="$Resources:Intranet,ListDefinition_CommunityDocuments_Description;"
Image="/_layouts/15/images/itdl.png"
DocumentTemplate="121"/>
</Elements>
And this is the schema.xml
<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="ListDefinitionCommunityDocuments" Direction="$Resources:Direction;" Url="ListDefinitionCommunityDocuments" BaseType="1" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x010100EC124370D330457F8AE8E5EC56DD1FE3" />
</ContentTypes>
<Fields>
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<Toolbar Position="After" Type="Freeform">
<IfHasRights>
<RightsChoices>
<RightsGroup PermAddListItems="required" />
</RightsChoices>
<Then>
<HTML><![CDATA[<div class="tb"><img src="/_layouts/15/images/caladd.gif" alt="" /> <a class="ms-addnew" id="idAddNewDoc" href="]]></HTML>
<HttpVDir />
<HTML><![CDATA[/_layouts/15/Upload.aspx?List=]]></HTML>
<ListProperty Select="Name" />
<HTML><![CDATA[&RootFolder=]]></HTML>
<GetVar Name="RootFolder" URLEncode="TRUE" />
<HTML><![CDATA[" onclick="javascript:NewItem(']]></HTML>
<ScriptQuote NotAddingQuote="TRUE">
<HttpVDir />
</ScriptQuote>
<HTML><![CDATA[/_layouts/15/Upload.aspx?List=]]></HTML>
<ListProperty Select="Name" />
<HTML><![CDATA[&RootFolder=]]></HTML>
<GetVar Name="RootFolder" URLEncode="TRUE" />
<HTML><![CDATA[', true);javascript:return false;" target="_self">]]></HTML>
<HTML>$Resources:core,Add_New_Document;</HTML>
<HTML><![CDATA[</a></div>]]></HTML>
</Then>
</IfHasRights>
</Toolbar>
<ViewFields>
<FieldRef Name="DocIcon"></FieldRef>
<FieldRef Name="LinkFilenameNoMenu"></FieldRef>
<FieldRef Name="Editor"></FieldRef>
</ViewFields>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noitemsinview_doclibrary)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noitemsinview_doclibrary_howto)" />
<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,Add_New_Document)" />
<ParameterBinding Name="MoreAnnouncements" Location="Resource(wss,MoreDocuments)" />
</ParameterBindings>
<Query>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
</OrderBy>
</Query>
</View>
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,All_Documents;" DefaultView="TRUE" MobileView="True" MobileDefaultView="True" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/15/images/dlicon.png" Url="Forms/AllItems.aspx">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<JSLink>clienttemplates.js</JSLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="DocIcon"></FieldRef>
<FieldRef Name="LinkFilename"></FieldRef>
<FieldRef Name="Modified"></FieldRef>
<FieldRef Name="Editor"></FieldRef>
<FieldRef Name="AverageRating" />
</ViewFields>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noitemsinview_doclibrary)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noitemsinview_doclibrary_howto2)" />
</ParameterBindings>
<Query>
<OrderBy>
<FieldRef Name="FileLeafRef" />
</OrderBy>
</Query>
</View>
</Views>
<Forms>
<Form Type="DisplayForm" SetupPath="pages\form.aspx" Url="Forms/DispForm.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" SetupPath="pages\form.aspx" Url="Forms/EditForm.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="Forms/Upload.aspx" WebPartZoneID="Main" />
</Forms>
</MetaData>
</List>
Any idea? Thank you very much