Need help setting up category list images

AI-generated summary

Category List Images Setup

fl4shback is seeking help to display category images in the category list, similar to user pictures on the recent view page. They managed to achieve the desired result temporarily by moving HTML elements in Chrome inspect mode, but prefer a more sustainable solution.

Benjamin_D suggests that this can be achieved through CSS modifications, pointing to a meta discussion on category image formatting and a search result for more examples.

However, fl4shback clarifies that their temporary solution involved moving HTML elements, and they would prefer to avoid describing images. Benjamin_D advises on overriding Discourse templates, but notes that this might require a plugin to make changes to the category index HTML.

nolo recommends using the discourse-category-group-boxes component, which provides cleaner markup and consistent styling across desktop and mobile devices.

Hi!

I would like to display category images in the category list kind of the same way users pictures are displayed on the recent view Catégories - Discourse Meta.

I kind of got the result I would like to have by fiddling around in chrome inspect mode.

Do you think this is achievable in CSS or do I need to edit html templates ?

Website is live at APF - Auberge du Pixel Fringant (apfcommu.ga) if you want to see it live.

Thanks for your time :slight_smile:

Hi !

I’d say very likely and it seems you’ve already found the way tinkering with chrome, so if your question is more “where to apply my modifications?”, you’ll find an example there:

and many more here Search results for 'category-list' - Discourse Meta

Not really, I cheated by moving around some html elements.

In the example, they got it to work by removing the category descriptions and adding the descriptions directly to the images. I’d prefer to avoid doing this.

Oh I see, my bad :sweat_smile:
so as I’m really not good at css and I’m not sure you should go down the road of position : relative, in case you’ll go for the html shuffling you’ll find this more useful:

and there is https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/templates/navigation/category.hbs , but as to make some changes to the discourse/app/views/categories/index.html.erb at main · discourse/discourse · GitHub , you’ll probably need a plugin.

Not really good in CSS myself either.

Thanks for the ressources, will try to look into that when I have some more time.

I will probably need to go down the plugin road..

I’d use this new component:
https://github.com/jordanvidrine/discourse-category-group-boxes.git

It will give you a cleaner markup to style with css. And have the same look on desktop and mobile with almost similar class selectors.