0

I am currently working on a site template to be deployed as a farm template.

In my home page I want to show the list of my custom libraries. I want to show them using promoted links.

Is there a way that I could create promoted links through visual studio?

1
  • Custom document libraries Commented Jul 15, 2019 at 7:59

1 Answer 1

0

Template Type ID for Promoted Links List is 170

You can try below list instance code in Visual Studio with SharePoint feature to create a new Promoted links list:

Follow below steps:

  • Create new empty element in Visual Studio solution.
  • In its element.xml file, copy paste below XML code.
  • Deploy the solution in SharePoint farm.

In SharePoint site, you will see new list will be created using "Menu" title and one item "Test 1" in it. This way you can add your required links in this list as shown in below code.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="Menu" OnQuickLaunch="TRUE" TemplateType="170" FeatureId="192efa95-e50c-475e-87ab-361cede5dd7f" Url="Lists/Menu" Description="List instance description">
    <Data>
      <Rows>
        <Row>
          <Field Name="Id">1</Field>
          <Field Name ="Title">Test 1</Field>
          <Field Name="Description">Test description</Field>
          <Field Name="LaunchBehavior">In page navigation</Field>
          <Field Name="TileOrder">0</Field>
          <Field Name="BackgroundImageLocation">~sitecollection/Style%20Library/Images/test.png</Field>
          <Field Name="LinkLocation">~sitecollection/SitePages/Home.aspx</Field>
        </Row>
      </Rows>
    </Data>
  </ListInstance>

</Elements>

Hope this will help you!

2
  • To what specific file should i these lines? Commented Jul 15, 2019 at 9:47
  • Create custom list in Visual Studio and make changes as per above code in that list's list instance and schema.xml files. Commented Jul 15, 2019 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.