• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RM 1.2 How to make a category heading for subcategories.

Mr Lucky

Well-known member
#1
I have grouped three categories as subcategories under one main category.

I don't want people to create resources in the main category, just the subcategories, ie it just appears as a category heading (like a category in the main node tree)

Yes, I can make it so people can't create resources there, however when they click on it, it just appears like any category (it has the list of resources available in is subcategories) but without the Add Resource button.

This is not good because it is not at all obvious that they then need to click on a subcategory to post.

What is the best way to achieve this category headings then that makes it obvious to users?

Thanks.
 

Chris D

XenForo developer
Staff member
#2
For that category, if you uncheck all of these:

upload_2015-8-23_14-48-22.png

Then the category will behave like this one: Add-ons | XenForo Community

You can't add resources to this category, but instead of it saying there are no resources to display, it instead displays all resources from the child categories. It displays the following heading above the list of resources: "Resources are being shown from all child categories".
 

Mr Lucky

Well-known member
#3
Exactly my point.

It is confusing because people don't know they must then click on one of its subcategories.

And the text you mention is tiny and faint.

Screen Shot 2015-08-23 at 14.53.58.png

I think to be consistent this should work like category headings for forums.
 

Chris D

XenForo developer
Staff member
#4
Never heard it called confusing before.

This is the only solution currently but maybe you would be able to style it accordingly to make it less confusing.
 

Mr Lucky

Well-known member
#5
Never heard it called confusing before.
You have now :) OK, but do you not see my point, that it would be good to have consistency about the way things work here?

This is the only solution currently but maybe you would be able to style it accordingly to make it less confusing.
Is there a conditional I can use to add content to just a specific resource category then?

Or a way to get a notice on just that category?
 

Chris D

XenForo developer
Staff member
#6
You have now :) OK, but do you not see my point, that it would be good to have consistency about the way things work here?
I have indeed. I don't currently see the need for any consistency here. It's a unique type of content so I don't see it needs to be compared or made equal to forums and categories. Just our opinion, of course. It might be an idea that's worth fleshing out and creating a suggestion for. It's not currently completely clear exactly what would need to happen to make it less confusing or more consistent.

Is there a conditional I can use to add content to just a specific resource category then?
Something like:
Code:
<xen:if is="{$resource.resource_category_id} == 999">Something</xen:if>
Where 999 is the desired category ID to affect. Depending on which template it is, you may need to swap $resource for $category.
 

Mr Lucky

Well-known member
#7
It's not currently completely clear exactly what would need to happen to make it less confusing or more consistent.
1) Make it a purely heading in the category list, showing above the subcategories, not a link.
2) Keep as, but it would automatically disallow any resources and show on the page the list of subcategories you can post resources into:

Add Resources to any of these subcategories:
            • Subcategory 1
            • Subcategory 2
            • Subcategory 3
            • Subcategory 4
So when you create it you get the option to create category header (just as you get the option in Node Tree to create category/forum/page etc)

yes, maybe it needs more thinking through but I know this would be easier for newbs.


Something like:
Code:
<xen:if is="{$resource.resource_category_id} == 999">Something</xen:if>
Where 999 is the desired category ID to affect.
Many thanks. I'm trying that but cannot find where to put the text.

I assumed it would be in resource_categories template? But that doesn't seem to work.

can you please say which template I add it to (I want it to appear just under the h1 header.

Thanks
 

Chris D

XenForo developer
Staff member
#9
The suggestion would be better off posted in the RM Suggestions forum.

I suspect you want the resource_index template.
 

Mr Lucky

Well-known member
#10
The suggestion would be better off posted in the RM Suggestions forum.

I suspect you want the resource_index template.

No, it does seem to be resource_category but the conditional doesn't work. It shows fine without the conditional (but in all categories of course).

I have changed it to the correct category ID, but just not showing.

Any idea what could be wrong?