Add list items to existing sharepoint list declaratively

14/11/2012 10:24

Put the same Title, TemplateType, Url

xml version="1.0" encoding="utf-8"?>

<Elements xmlns="https://schemas.microsoft.com/sharepoint/">

<ListInstance Title="Reusable Content"

OnQuickLaunch="FALSE"

TemplateType="100"

Url="ReusableContent">

<Data>

<Rows>

<Row>

<Field Name= "Title" >Prvy PokusField >

<Field Name="ContentCategory">Blog1Field>

Row>

Rows>

Data>

ListInstance>

Elements>

 

Add items to list, URL field (It's displayed as UrlDescription with UrlLink hyperlink)

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="https://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="LinksList"
                OnQuickLaunch="FALSE"
                TemplateType="103"
                FeatureId="10bfea71-2062-426c-90bf-714c59600103"
                Url="Lists/LinksList"
                Description="">
    <Data>
      <Rows>
        <Row>
          <Field Name="URL">https://www.e-shop.sk/home, e-Shop</Field>
        </Row>
        <Row>

         <!--Field type URL-->
          <Field Name="URL">https://www.mallibu.sk, Malibu SK</Field>

        <!--Field type Image-->

         <Field Name="ImageHeader">

                 &lt;img alt=&quot;&quot; src=&quot;/PublishingImages/headerImage.jpg&quot; style=&quot;BORDER: 0px solid; &quot;&gt;

         </Field>


        </Row>
      </Rows>
    </Data>
  </ListInstance>
</Elements>