简体   繁体   English

Joomla 3.5模块开发后端XML结构

[英]Joomla 3.5 Module Developing Backend XML Structure

I try to make my first Joomla Module. 我尝试制作我的第一个Joomla模块。 This module can at the moment output 4 boxes. 此模块目前可以输出4个盒子。 I implement the 4 boxes manualy in the XML and in the template file. 我在XML和模板文件中手动实现了4个框。 And i difine the variables like this: 我将变量定义如下:

'Title1' => $params->get('devServiceTitle1'),
'Icon1' => $params->get('devServiceIcon1'),
'Content1' => $params->get('devServiceContent1'),

'Title2' => $params->get('devServiceTitle2'),
'Icon2' => $params->get('devServiceIcon2'),
'Content2' => $params->get('devServiceContent2'),

'Title3' => $params->get('devServiceTitle3'),
'Icon3' => $params->get('devServiceIcon3'),
'Content3' => $params->get('devServiceContent3'),

'Title4' => $params->get('devServiceTitle4'),
'Icon4' => $params->get('devServiceIcon4'),
'Content4' => $params->get('devServiceContent4'),

This looks for me very ugly and unclean... And at last i want to make a dropdown field, in the XML in that the user can select other counts of Boxes... 3, 4, 6 and 8... And this is not all. 这看起来非常丑陋和不干净...最后,我想在XML中创建一个下拉字段,用户可以选择其他计数的Boxs ... 3、4、6和8 ...这还不是全部。 I need to make a Selection for the Template file to... I search sience 2 weeks in google, but i dont find any answere to my questions. 我需要对模板文件进行选择以...我在google中搜索了2个星期,但是我没有找到任何答案。 so i ask here. 所以我在这里问。

You want to add this fields in the module back-end? 您要在模块后端添加此字段吗?

if yes than You have to add like below. 如果是,则必须添加以下内容。

            <field name="boxwidth" type="text" default="300" label="Box Width" description="Like Box Width" />
            <field name="boxheight" type="text" default="300" label="Box Height" description="Like Box Height" />

            <field name="colorscheme" type="list" default="light" label="Color scheme" description="Color Scheme">
                <option value="light">Light</option>
                <option value="dark">Dark</option>
            </field>
            <field name="showfaces" type="list" default="true" label="Show Faces" description="Show Faces">
                <option value="true">Yes</option>
                <option value="False">No</option>
            </field>
            <field name="showheader" type="list" default="true" label="Show Header" description="Show Header">
                <option value="true">Yes</option>
                <option value="False">No</option>
            </field>
            <field name="showborder" type="list" default="true" label="Show Border" description="Show Border">
                <option value="true">Yes</option>
                <option value="false">No</option>
            </field>


        </fieldset>
    </fields>
</config>

if you want to create four fields on site side just create simple html form on module file. 如果要在站点侧创建四个字段,只需在模块文件上创建简单的html表单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM