Nos gustaría ocultar el botón +Nuevo Tema en las categorías de nivel superior cuando hay subcategorías presentes. Encontré una publicación que mostraba cómo ocultar el botón +Nuevo Tema en la pantalla de la categoría principal, pero aún aparece en las pantallas de las categorías de nivel superior.
No permitimos que los usuarios publiquen en categorías de nivel superior cuando hemos creado subcategorías, por lo que el botón +Nuevo Tema no es necesario.
I don’t think there is a built in way, but you can achieve this with some simple CSS.
Edit!
I think it’s even less involved than what I describe below if you are applying it to ALL top level categories. Try adding this to your theme’s Common CSS first:
// Remove the New Topic button from all top-level categories
.categories-list:not(.navigation-categories) {
button#create-topic{
display: none;
}
}
More involved way
First you’ll need to find the category slug of the top-level categories (Note: This is strictly for top-level categories. Sub-categories are a little different.)
For example, if we take the URL for the support category here on Meta: https://meta.discourse.org/c/support
The slug is whatever is after the /c/part of the URL. In this case it’s support. If your category has multiple words in it, it will have dashes like questions-and-answers
The CSS will be looking for a class that starts with category- and continues with the slug of the top-level category. So for the above examples, you would use category-support and category-questions-and-answers
So with that in mind, you can customize the following CSS to fit your needs, and add it to the Common CSS section of your theme:
Gracias por la ayuda. Es posible que tengamos algunas categorías principales con subcategorías en las que sea aceptable publicar. La forma más detallada hizo exactamente lo que necesitaba.