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

Commented Unassigned: Including XML in DynamicTypeForm XML [1854]

$
0
0
I have a few DynamicTypeForm XML files that includes the same set of fields (static data types that inhierit the fields from a base class). It would be nice to be able to place this set of fields in a separate file and include it in the DynamicTypeForm XML files.
Comments: ** Comment from web user: burningice **

It should be fairly easy to make... The EditPage workflow does it for injecting Metadata fields and the C1Contrib FormBuilder also does it (inspired by how the Metadata tab work on Pages) https://bitbucket.org/burningice/compositec1contrib.formbuilder/src/bbee75568b4575a8183090440271dbfd397ca217/FormBuilder.Dynamic/C1Console/Workflows/EditFormFieldWorkflow.cs?at=default#cl-72

I would suggest adding a new attribute to elements ala

<Placeholder formSource="SomeFile.xml" />

and the content of SomeFile.xml would then be

<?xml version="1.0" encoding="utf-8"?>
<cms:formdefinition xmlns="http://www.composite.net/ns/management/bindingforms/std.ui.controls.lib/1.0" xmlns:cms="http://www.composite.net/ns/management/bindingforms/1.0">
<cms:bindings>
<cms:binding name="Rows" type="System.Int32" />
</cms:bindings>

<cms:layout>
<Placeholder>
<FieldGroup>
<TextBox Label="Rows">
<TextBox.Text>
<cms:bind source="Rows"/>
</TextBox.Text>
</TextBox>
</FieldGroup>
</Placeholder>
</cms:layout>
</cms:formdefinition>

Where its crucual that the first element in <cms:layout> is the same Element Name as the one having the formSource atribute in the parent xml-file. This would follow the general convention of including configuration files in .Net.


Viewing all articles
Browse latest Browse all 2540

Trending Articles



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