Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

i've a problem with the customization of the toolbar in a list definition created in a custom view. I write the following code:

    <View BaseViewID="4" Name="f879f300-9dc7-4bcb-9e16-7dee86a118d7" DisplayName="Admin View" Type="HTML" WebPartZoneID="Main" SetupPath="pages\viewpage.aspx" Url="Admin View.aspx">
 <Toolbar Position="After" Type="Freeform">
          <IfHasRights>
            <RightsChoices>
              <RightsGroup PermAddListItems="required" />
            </RightsChoices>
            <Then>
              <HTML><![CDATA[<div class="tb"><img src="/_layouts/15/images/caladd.gif?rev=23" alt="" />&#160;<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>TEST</HTML>
              <HTML><![CDATA[</a></div>]]></HTML>
            </Then>
          </IfHasRights>
        </Toolbar>
        <RowLimit>30</RowLimit>
        <ViewFields>
          <FieldRef Name="Edit" />
          <FieldRef Name="LinkFilename" />
          <FieldRef Name="Title" />
        </ViewFields>
        <Query />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <JSLink>clienttemplates.js</JSLink>

      </View>

But the selected view shows always the "Add new item or drag a file here" link. I've also tried example code like:

<Toolbar Position="After" Type="Freeform">
              <HTML><![CDATA[<h1> HELLO WORLD </h1>]]></HTML>
        </Toolbar>

But the result is the same... What wrong in the code above?

share|improve this question
    
Why can't we do this in onet.xml file.....this is just a setting in the web part. –  user18068 Jul 5 '13 at 3:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.