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

New Post: Adding to NewsItem.xml

$
0
0
I have installed the News package on a new site running v4.1. I am needing to customize the package a bit.

I have everything done except I need to know how to add the correct widget element to the NewsItem.xml file. I have two additional fields I need to add to the NewsItems.xml
  1. I need to add a <DataReferenceSelector /> to select a MediaFolder, the DataFolder field name is GallerFolder
  2. I need to add a <KeySelector /> to select an MediaImage, the DataFolder field name is TeaserImage
Here is the current NewsItem.xml file. I have already added a <TextBox> widget element so I can add a youtube video to the news article.
<cms:formdefinition xmlns:cms="http://www.composite.net/ns/management/bindingforms/1.0" xmlns="http://www.composite.net/ns/management/bindingforms/std.ui.controls.lib/1.0" xmlns:f="http://www.composite.net/ns/management/bindingforms/std.function.lib/1.0">
    <cms:bindings>
        <cms:binding name="Title" type="System.String" optional="true" />
        <cms:binding name="Date" type="System.DateTime" optional="true" />
        <cms:binding name="Teaser" type="System.String" optional="true" />
        <cms:binding name="YoutubeVideo" type="System.String" optional="true" />
        <cms:binding name="Description" type="System.String" optional="true" />     
        <cms:binding name="TitleUrl" type="System.String" optional="true" />
    </cms:bindings>
    <cms:layout>
        <cms:layout.label>
            <cms:read source="Title" />
        </cms:layout.label>
        <TabPanels>
            <PlaceHolder Label="Settings">
                <FieldGroup>
                    <TextBox Label="Title" Help="The title of the news item">
                        <TextBox.Text>
                            <cms:bind source="Title" />
                        </TextBox.Text>
                    </TextBox>
                    <DateTimeSelector Label="Date" Help="The date of the news item">
                        <DateTimeSelector.Date>
                            <cms:bind source="Date" />
                        </DateTimeSelector.Date>
                    </DateTimeSelector>
                    <TextArea Label="Teaser" Help="The short description of the news item">
                        <TextArea.Text>
                            <cms:bind source="Teaser" />
                        </TextArea.Text>
                    </TextArea>
                    <TextBox Label="Youtube Video" Help="Insert Youtube Video">
                        <TextBox.Text>
                            <cms:bind source="YoutubeVideo" />
                        </TextBox.Text>
                    </TextBox>
                    <DataReferenceSelector Label="Gallery Folder" Help="The date of the news item">
                        <DataReferenceSelector>
                            <cms:bind source="GalleryFolder" />
                        </DataReferenceSelector>
                    </DataReferenceSelector>
                </FieldGroup>
            </PlaceHolder>
            <XhtmlEditor Label="News Story" Help="News Story" ClassConfigurationName="common">
                <XhtmlEditor.Xhtml>
                    <cms:bind source="Description" />
                </XhtmlEditor.Xhtml>
            </XhtmlEditor>

        </TabPanels>
    </cms:layout>
</cms:formdefinition>

Viewing all articles
Browse latest Browse all 2540

Trending Articles



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