Faq Objekt, 2. Schritt => Eingabeformular (Form) bzw. Faq config.xml (Form) - definitive Version
"Roger Fischer" <[email protected]>
| Newsgroups | gmane.comp.cms.bitflux.general.german |
|---|---|
| Message-ID | <[email protected]> |
Das config.xml befindet sich im Ordner $PROJECT_DIR/www/admin/form/Faq
Drei Ãnderungen:
- type "abstract" für fields question und answer
- <bxco:field name="objectname" value="Faq"/> anstatt 'value="Chapter"'
Die ersten zwei Ãnderungen machen die Eingabefelder etwas kleiner. Die
letzte Ãnderung macht, dass das Faq-Objekt auch wirklich ans Document
angeheftet wird.
config.xml
----------
<?xml version="1.0" encoding="iso-8859-1"?>
<bxco:config xmlns:bxco="http://bitflux.org/config/1.0">
<bxco:fields table="Faq">
<bxco:field name="lang" type="text" descr="Language">de</bxco:field>
<bxco:field name="title" type="text" descr="Title"/>
<bxco:field name="faqinfo_keywordset" type="abstract"
descr="Keywordset"/>
<bxco:field name="question" type="abstract" descr="Question"/>
<bxco:field name="answer" type="abstract" descr="Answer"/>
<bxco:field name="rang" descr="Rang" type="int" >
</bxco:field>
<bxco:field name="Document2Object" type="n2m" alternativeDescr="Document"
descr="Parent::Document" defaultXpath="default/parentid">
<bxco:n2m thisfield="foreignobjectid"
thatfield="foreigndocumentid" objectfield="objectname"
objectfieldvalue="Faq"/>
<bxco:foreign>
<bxco:table name="Document"
field="title "
orderby="title"
/>
</bxco:foreign>
</bxco:field>
<bxco:field name="created" alternativeDescr="CREATED"
descr="Created" type="fixed" subtype="datetime">
<bxco:onnew default="sql:now()" />
</bxco:field>
<bxco:field name="createdby" alternativeDescr="CREATEDBY"
descr="Created by" type="fixed" >
<bxco:onnew defaultXpath="auth/username" />
</bxco:field>
<bxco:field name="changed" alternativeDescr="CHANGED"
descr="Changed" type="fixed" subtype="datetime">
<bxco:onnew default="sql:now()" />
<bxco:onchange default="sql:now()" />
</bxco:field>
<bxco:field name="changedby" alternativeDescr="CHANGEDBY"
descr="Changed by" type="fixed">
<bxco:onnew defaultXpath="auth/username" />
<bxco:onchange defaultXpath="auth/username" />
</bxco:field>
</bxco:fields>
<bxco:chooser field="concat(title,' (',lang,')')" orderby="title"
descr="Choose Faq"/>
<bxco:create>
<bxco:table name="Document2Object" hide="yes">
<bxco:field name="foreigndocumentid"
value="this:Document2Object:Value" notempty="1"/>
<bxco:field name="objectname" value="Faq"/>
<bxco:field name="foreignobjectid" value="this:ID"
notempty="1"/>
</bxco:table>
</bxco:create>
</bxco:config>