简体   繁体   中英

Joomla plugin with dynamic parameters

I'm writting a plugin for Joomla (first time working with Joomla) and I'm in need of something a bit different for the plugin options/parameters.

I need to have a field for each user group with a select that has a list of options. I'm not looking for a select with the list of user groups, what I need is the opposite, a parameter for each user group.

I'm guessing I can't use xml for this and it has to be programatically but I have no idea how to do this and I've been looking for hours now without any luck.

Any help is appreciated, Thanks in advance

您是否已从Joomla文档中检查了SQL表单字段的类型

You may create custom form field.

Look in administrator/components/com_banners/models/fields/ .

Place the code in plugins/plugintype/pluginname/fields/customfield.php

In plugin configuration (pluginname.xml) add field path:

<config>
    <fields
        name="params"
        addfieldpath="/plugins/plugintype/pluginname/fields"
    >
        <fieldset
            name="basic"
        >
            <field
                name="customfield"
                type="customfield"
            />
        </fieldset>
    </fields>
</config>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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