Skip to content

Commit

Permalink
Create custom admin article menus (#20890)
Browse files Browse the repository at this point in the history
* Create custom admin article menus

See #20233 for detailed explanation of the use case

### Test Instructions

Create and enable an admin menu with the "Joomla preset"

Create a new admin menu item of type article list and you can see you now have a full set of filters that you can apply.

For example you can now create menu items in the admin to each category.

If approved I will create the same option for other components

This does not resolve everything on #20233 as it still needs field categories to be implemented for that

* Update default.xml

* Update en-GB.com_menus.ini

* add filters

* add viewing access level

* Update default.xml

* Update default.xml
  • Loading branch information
brianteeman authored and Michael Babker committed Jul 7, 2018
1 parent af70242 commit 3ddbac5
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,79 @@
<![CDATA[COM_CONTENT_ARTICLES_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_categories/models/fields"
>
<field
name="filter_category_id"
type="modal_category"
label="COM_MENUS_ADMIN_CATEGORY_LABEL"
description="COM_MENUS_ADMIN_CATEGORY_DESC"
extension="com_content"
select="true"
new="true"
edit="true"
clear="true"
filter="integer"
/>

<field
name="filter_level"
type="integer"
label="COM_MENUS_ADMIN_LEVEL_LABEL"
description="COM_MENUS_ADMIN_LEVEL_DESC"
first="1"
last="10"
step="1"
languages="*"
filter="integer"
>
<option value="">JOPTION_SELECT_MAX_LEVELS</option>
</field>

<field
name="filter_author_id"
type="author"
label="COM_MENUS_ADMIN_AUTHOR_LABEL"
description="COM_MENUS_ADMIN_AUTHOR_DESC"
multiple="true"
class="multipleAuthors"
filter="int_array"
>
<option value="0">JNONE</option>
</field>

<field
name="filter_tag"
type="tag"
label="COM_MENUS_ADMIN_TAGS_LABEL"
description="COM_MENUS_ADMIN_TAGS_DESC"
multiple="true"
filter="int_array"
/>

<field
name="filter_access"
type="accesslevel"
label="COM_MENUS_ADMIN_ACCESS_LABEL"
description="COM_MENUS_ADMIN_ACCESS_DESC"
multiple="true"
filter="int_array"
/>

<field
name="filter_language"
type="contentlanguage"
label="COM_MENUS_ADMIN_LANGUAGE_LABEL"
description="COM_MENUS_ADMIN_LANGUAGE_DESC"
>
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>

</fieldset>
</fields>

</metadata>
14 changes: 14 additions & 0 deletions administrator/language/en-GB/en-GB.com_menus.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ COM_MENUS_ACTION_DESELECT="Deselect"
COM_MENUS_ACTION_EXPAND="Expand"
COM_MENUS_ACTION_SELECT="Select"
COM_MENUS_ADD_MENU_MODULE="Add a module for this menu"
COM_MENUS_ADMIN_ACCESS_DESC="Filter by viewing access level."
COM_MENUS_ADMIN_ACCESS_LABEL="Access"
COM_MENUS_ADMIN_AUTHOR_DESC="Filter by author."
COM_MENUS_ADMIN_AUTHOR_LABEL="Author"
COM_MENUS_ADMIN_CATEGORY_DESC="Filter by category."
COM_MENUS_ADMIN_CATEGORY_LABEL="Category"
COM_MENUS_ADMIN_FILTER_DESC="Apply filters to the menu item."
COM_MENUS_ADMIN_FILTER_LABEL="Filter"
COM_MENUS_ADMIN_LANGUAGE_DESC="Filter by language."
COM_MENUS_ADMIN_LANGUAGE_LABEL="Language"
COM_MENUS_ADMIN_LEVEL_DESC="The number of subcategory levels to display."
COM_MENUS_ADMIN_LEVEL_LABEL="Subcategory Levels"
COM_MENUS_ADMIN_TAGS_DESC="Filter by tags."
COM_MENUS_ADMIN_TAGS_LABEL="Tags"
COM_MENUS_ADVANCED_FIELDSET_LABEL="Advanced"
COM_MENUS_BASIC_FIELDSET_LABEL="Options"
COM_MENUS_BATCH_MENU_ITEM_CANNOT_CREATE="You are not allowed to create new menu items."
Expand Down

0 comments on commit 3ddbac5

Please sign in to comment.