0

I have written a small and simple bootstrap carousel module. Articles having a specific category will be shown in this module. I'm wondering how to add a dropdown list in the admin panel to select another category.

Look at the image below. I'd like to add a dropdown of all categories there.

enter image description here

0

In your module XML file, add the following:

<config>
    <fields name="params">
        <fieldset name="basic">
            <field name="mycategory" type="category" extension="com_content" label="Select a category" description="" />
        </fieldset>
    </fields>
</config>

type="category" is one of the default Joomla form fields that will pull all categories from the extension you specify, which in the case above, will pull them from extension="com_content"

Hope this helps

  • Awesome, thx. Where is the information of the selected value stored so I can use it in my helper.php? – DaFunkyAlex Jan 27 '15 at 13:43
  • It's stored in the database like all other parameter values. Have read through the Joomla documentation for getting module parameters and ask a new question if you run into any issues – Lodder Jan 27 '15 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.