problem to add categories to admin view #172

Closed
opened 2017-11-06 10:46:05 +00:00 by ebrahimiali9005 · 4 comments
ebrahimiali9005 commented 2017-11-06 10:46:05 +00:00 (Migrated from github.com)

hello.

  1. I created a Component called "library".

  2. I created a field with the following specifications
    Type : category
    Name : catid
    Data Type : int
    XML :

    type="category"
    name="listcategory"
    label="Select a category"
    extension="com_library.lists"
    scope=""
    required="true"
    show_root="false"
    default=""
    description="select one of the following categories"
    class="inputbox"
    published="true"
    multiple="false"
    showon=""

  3. I created a Admin View called "list".

  4. Add filed catid in list view

  5. I linked view to component.

  6. compile & install

  7. insert category in library component
    but in create list cannot select category. list is empety.

Export of Component is : https://www.dropbox.com/s/9u0uazi95acs99u/JCB_library.zip?dl=1

hello. 1. I created a Component called "library". 2. I created a field with the following specifications Type : category Name : catid Data Type : int XML : type="category" name="listcategory" label="Select a category" extension="com_library.lists" scope="" required="true" show_root="false" default="" description="select one of the following categories" class="inputbox" published="true" multiple="false" showon="" 3. I created a Admin View called "list". 4. Add filed catid in list view 5. I linked view to component. 6. compile & install 7. insert category in library component but in create list cannot select category. list is empety. Export of Component is : https://www.dropbox.com/s/9u0uazi95acs99u/JCB_library.zip?dl=1
ro-ot commented 2017-11-06 11:27:26 +00:00 (Migrated from github.com)

Try it without the show_root="false" since I see have categories in many of my components and it does not have that value set.

The name must be catid

<field 
	type="category" 
	name="catid" 
	label="Category" 
	extension="com_###component###.lists"
	default="" 
	description="select any of the following categories" 
	class="inputbox"
	multiple="false"
/>

So the above should work, it does for me. I use categories all over the place.

Try it without the `show_root="false"` since I see have categories in many of my components and it does not have that value set. The name must be **catid** ``` <field type="category" name="catid" label="Category" extension="com_###component###.lists" default="" description="select any of the following categories" class="inputbox" multiple="false" /> ``` So the above should work, it does for me. I use categories all over the place.
ebrahimiali9005 commented 2017-11-06 11:44:51 +00:00 (Migrated from github.com)

Thank you very much.
I've been fixing this problem for a week.

Thank you very much. I've been fixing this problem for a week.
kevincam3 commented 2017-11-06 13:06:31 +00:00 (Migrated from github.com)

What was breaking mine was the instructions for published: I was using "true" but that's not correct

JCB:
published (optional) (true/false) is whether the drop down will show only published or unpublished categories.

Joomla! Site:
published (optional) (1/0/2/-2) is whether the drop down will show only published (1), unpublished (0), archived (2) or trashed (-2) categories. It is possible to combine different publishing status by entering the list of the corresponding numbers separated by comma (e.g. "0,2,-2" will display only unpublished, archived and trashed categories in the drop-down).

What was breaking mine was the instructions for published: I was using "true" but that's not correct JCB: published (optional) (true/false) is whether the drop down will show only published or unpublished categories. Joomla! Site: published (optional) (1/0/2/-2) is whether the drop down will show only published (1), unpublished (0), archived (2) or trashed (-2) categories. It is possible to combine different publishing status by entering the list of the corresponding numbers separated by comma (e.g. "0,2,-2" will display only unpublished, archived and trashed categories in the drop-down).
kevincam3 commented 2017-11-06 13:16:57 +00:00 (Migrated from github.com)

If you want to see what things you can use that affect the options list look here:
libraries/legacy/form/field/category.php

If you want to see what things you can use that affect the options list look here: libraries/legacy/form/field/category.php
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#172
No description provided.