How to add categories to my admin view #153

Closed
opened 2017-10-27 15:06:34 +00:00 by kevincam3 · 12 comments
kevincam3 commented 2017-10-27 15:06:34 +00:00 (Migrated from github.com)

I couldn't find a video that explained this from beginning to end. I found this one and followed the instructions and the categories but my category field doesn't work.

https://www.youtube.com/watch?v=9NO2rKnC6Ug&feature=youtu.be&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=29m24s

image

image

I couldn't find a video that explained this from beginning to end. I found this one and followed the instructions and the categories but my category field doesn't work. https://www.youtube.com/watch?v=9NO2rKnC6Ug&feature=youtu.be&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=29m24s ![image](https://user-images.githubusercontent.com/870934/32110893-9c403514-bb17-11e7-8ccf-cd946fef4711.png) ![image](https://user-images.githubusercontent.com/870934/32110906-a3f29b80-bb17-11e7-9ada-dbc47ca63a63.png)

Give me the xml of your category field and I will see it I can help you.

The conventions are strongly following that if Joomla. So just researching how you would normaly add categories to your component and views if you where to hand code it should resolve the issue.

I think the first tutorial says that JCB is for PHP developers who know the Joomla API well enough to build a component manually. Since if you do not know the Joomla API, you will be stuck making use of only the basic features of JCB.

But sure, give me a look at your category (field) XML and I should be able to fix this for you :)

Give me the xml of your category field and I will see it I can help you. The conventions are strongly following that if Joomla. So just researching how you would normaly add categories to your component and views if you where to hand code it should resolve the issue. I think the first tutorial says that JCB is for PHP developers who know the Joomla API well enough to build a component manually. Since if you do not know the Joomla API, you will be stuck making use of only the basic features of JCB. But sure, give me a look at your category (field) XML and I should be able to fix this for you :)
kevincam3 commented 2017-10-27 15:22:45 +00:00 (Migrated from github.com)

Here's my XML:

Here's my XML: <field type="category" name="catid" label="Category" extension="com_soundwave" scope="" required="true" show_root="false" default="" description="select one of the following categories" class="inputbox" published="true" showon="" />
kevincam3 commented 2017-10-27 15:23:06 +00:00 (Migrated from github.com)
<field 
	type="category" 
	name="catid" 
	label="Category" 
	extension="com_soundwave" 
	scope="" 
	required="true" 
	show_root="false" 
        default=""
	description="select one of the following categories" 
	class="inputbox"
        published="true"
       showon=""  
/>
``` <field type="category" name="catid" label="Category" extension="com_soundwave" scope="" required="true" show_root="false" default="" description="select one of the following categories" class="inputbox" published="true" showon="" /> ```
<field 
	type="category" 
	name="catid" 
	label="Category" 
	extension="com_soundwave.waves" 
	scope="" 
	required="true" 
	show_root="false" 
        default=""
	description="select one of the following categories" 
	class="inputbox"
        published="true"
       showon=""  
/>

Should do the trick.

``` <field type="category" name="catid" label="Category" extension="com_soundwave.waves" scope="" required="true" show_root="false" default="" description="select one of the following categories" class="inputbox" published="true" showon="" /> ``` Should do the trick.
kevincam3 commented 2017-10-27 15:56:44 +00:00 (Migrated from github.com)

Unfortunately that didn't work. Still functions the same. I didn't notice that almost always the view=waves, but when I edit one of the waves then save it, the url list view=Waves, with the capital, only after saving does this happen. I don't know if it's related but just some FYI

Unfortunately that didn't work. Still functions the same. I didn't notice that almost always the view=waves, but when I edit one of the waves then save it, the url list view=Waves, with the capital, only after saving does this happen. I don't know if it's related but just some FYI

Please check out Sermon Distributors Implementation, since in it we give you first hand demonstration of using the category integration.

About he change of the capital, I don't think that matters since the view=thisValue is all ways converted to lower case in the controller.

Please check out Sermon Distributors Implementation, since in it we give you first hand demonstration of using the category integration. About he change of the capital, I don't think that matters since the view=thisValue is all ways converted to lower case in the controller.

any success?

any success?
kevincam3 commented 2017-10-30 02:37:47 +00:00 (Migrated from github.com)

I haven't gotten around to debugging it yet and getting a better understanding of categories. I just assumed adding the category field was enough for it to start working. But I'll look under the hood this week to better understand what Joomla! does when you add the category field so I'll know why it's not working.

I haven't gotten around to debugging it yet and getting a better understanding of categories. I just assumed adding the category field was enough for it to start working. But I'll look under the hood this week to better understand what Joomla! does when you add the category field so I'll know why it's not working.
ebrahimiali9005 commented 2017-11-06 06:44:23 +00:00 (Migrated from github.com)

hello.
i have same problem.
i can't select category.

One week I've done any tests that may be possible.
I've also reviewed many of your educational videos.

hello. i have same problem. i can't select category. One week I've done any tests that may be possible. I've also reviewed many of your educational videos.
kevincam3 commented 2017-11-15 13:16:43 +00:00 (Migrated from github.com)

@Llewellynvdm I just wanted to report back that I found out what was causing the problem. Two things that you need to make sure are set correctly if any one of them is wrong it won't work.

In the xml for the field make sure you call out the plural of the view you want to add the category field to and make sure you set published equal to a number.

So the following in my xml got it to start working:

published="1"
extension="com_centgames.games

previously I had:
published="true"
extension="com_centgames"

So both values were wrong. I hope that helps anyone with this problem.

@Llewellynvdm I just wanted to report back that I found out what was causing the problem. Two things that you need to make sure are set correctly if any one of them is wrong it won't work. In the xml for the field make sure you call out the plural of the view you want to add the category field to and make sure you set published equal to a number. So the following in my xml got it to start working: published="1" extension="com_centgames.games previously I had: published="true" extension="com_centgames" So both values were wrong. I hope that helps anyone with this problem.
kevincam3 commented 2017-11-15 13:30:05 +00:00 (Migrated from github.com)

@Llewellynvdm you should update the default instructions about the "published" field since currently they suggest using "true/false" which is incorrect. I updated them on my local machine already.

From the Joomla website:

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).

@Llewellynvdm you should update the default instructions about the "published" field since currently they suggest using "true/false" which is incorrect. I updated them on my local machine already. From the Joomla website: 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).

Okay, I have done that. But please note this will only work on new installs.

Okay, I have done that. But please note this will only work on new installs.
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#153
No description provided.