Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Tree definitions - references in tree?

$
0
0

I have a datastore named "Offers" that I want to use in a tree definition under the Content tab. When I create an "Offer" I select a reference to another datastore (Stores).

My datastores:

Offers:
-Title :string
-Description :string
-Store :reference to Stores

Stores:
-Name :string

I use this code to build a tree:

<?xml version="1.0" encoding="utf-8" ?>
<ElementStructure xmlns="http://www.composite.net/ns/management/trees/treemarkup/1.0" xmlns:f="http://www.composite.net/ns/function/1.0">
  <ElementStructure.AutoAttachments>
    <NamedParent Name="Content" Position="Bottom" />
  </ElementStructure.AutoAttachments>
  <ElementRoot>
    <Children>
      <Element Id="StoreOffersRoot" Label="Erbjudanden" Icon="folder">
        <Actions>
          <AddDataAction Type="C1DB.Stores.Offers" />
        </Actions>
        <Children>
          <DataFolderElements Type="C1DB.Stores.Offers" FieldGroupingName="Store" Icon="folder" Display="Compact">
            <Children>
              <DataElements Type="C1DB.Stores.Offers" Label="${C1:Data:C1DB.Stores.Offers:Title}" Icon="data" Display="Auto">
                <Actions>
                  <EditDataAction />
                  <DeleteDataAction />
                </Actions>
                <OrderBy>
                  <Field FieldName="EndDate" Direction="descending" />
                </OrderBy>
              </DataElements>
            </Children>
          </DataFolderElements>
        </Children>
      </Element>
    </Children>
  </ElementRoot>
</ElementStructure>

This will give me this result:
Image

As you see the "Store" folder only shows the guid to the Store i've set to reference when I create an "Offer". Is it possible to get the "Name" field of that reference?


Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>