1

I use the below form field in the filter_mypage.xml of my custom component.

<field
    name="state"
    type="status"
    label="JOPTION_SELECT_PUBLISHED"
    onchange="this.form.submit();">
      <option value="">JOPTION_SELECT_PUBLISHED</option>
</field>

By default this shows the options Trashed, Unpublished, Published, Archived, All

I do not want the Archived option and want to remove from the list. Is this possible?

5

You can either make your own options (see Hasanalsamra's answer) or use the filter option of the status field:

<field
    name="state"
    type="status"
    filter="*,0,1,-2"
    label="JOPTION_SELECT_PUBLISHED"
    onchange="this.form.submit();"
    >
    <option value="">JOPTION_SELECT_PUBLISHED</option>
</field>

For reference:

* = all
0 = unpublished
1 = published
2 = archived
-2 = trashed

An example of this usage can be found in the core backend component com_menu (\administrator\components\com_menus\models\forms\filter_items.xml)

4

Yes, you can make your own options, here is how:

<field
    name="state"
    type="list"
    label="JOPTION_SELECT_PUBLISHED"
    onchange="this.form.submit();">
    <option value="">JOPTION_SELECT_PUBLISHED</option>
    <option value="-2">JTRASHED</option>
    <option value="0">JUNPUBLISHED</option>
    <option value="1">JPUBLISHED</option>
    <option value="*">JALL</option>
</field>

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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