2017-06-14 5 views
0

私は、複数の証言セクション(ウェブサイト用)の作成と編集を可能にする簡単なサブフォームモジュールを作成しようとしています。ですから、セクションごとに2つのテキスト変数を取るだけです。証言セクションを追加/削除することができます。Joomlaサブフォームモジュール

さて、私はこの上の完全なチュートリアルを探してきた - 私が発見した唯一のものは、ドキュメントからだった:https://docs.joomla.org/Subform_form_field_type/en

だから、私はこれが私の上で動作していない理由としてカップルのアイデアを持っています終わり。

まず、サブフォームのフィールドはEXTENSION xmlに入りますか?主なxmlファイル、ファイルセクション、著者、名前、設定、フィールドセット、フィールド(s)???

私のコードは次のとおりです。 ... ...

<version>1.0</version> 
    <description>Testimony Section</description> 
    <files> 
     <filename module="mod_testimonyfive">mod_testimonyfive.php</filename> 
     <filename>index.html</filename> 
     <filename>mod_testimonyfive.xml</filename> 
     <filename>helper.php</filename> 
     <filename>tmpl/default.php</filename> 
     <filename>tmpl/index.html</filename> 
    </files> 
    <config> 

     <fieldset> 
       <field name= "params" 
        description= "testimony" 
        type= "subform" 
        label= "testimony" 
        min= "1" 
        max= "12" 
        required= "true"    
        formsource= "components/com_testimony/testimony.xml" 
        multiple= "true" 
        buttons= "add,remove" 
       layout="joomla.form.field.subform.repeatable-table" 
        groupByFieldset="false"/> 
    </fieldset> 
    </config> 
</extension> 

第二に、そのformsource?私が持っている唯一のものはXMLファイルです。私はもっ​​と必要ですか???そのXMLファイルは、次のような次のとおりです。

<?xml version="1.0" encoding="UTF-8"?> 
<form> 
     <field name="testimony_visible" type="text" label="Testimony Visible" /> 
     <field name="testimony_hidden" type="text" label="Testimony Hidden" /> 
</form> 

答えて

0

[OK]を、ので、それはフィールドのように設定する必要があります - >フィールドセット - >その後、フィールド

<fields name="params"> 
     <fieldset name="basic"> 
     <field name= "params" 
       description= "testimony" 
       type= "subform" 
       label= "testimony" 
       min= "1" 
       max= "12" 
       required= "true"    
       formsource= "components/com_testimony/testimony.xml" 
       multiple= "true" 
       buttons= "add,remove" 
      layout="joomla.form.field.subform.repeatable-table" 
       groupByFieldset="false"/> 
     </fieldset> 
    </fields> 
関連する問題