Latest list as grid view

AI-generated summary

The discussion is about setting the latest list view in grid style for a custom Discourse theme. daemon is trying to achieve this without using images in posts and wants the columns to be flexible based on screen resolution.

anderer suggests using Custom CSS to set the max-width and adjust the number of columns. However, daemon is looking for a CSS class to turn the list into a grid and wants a flexible layout.

merefield explains that the Topic List Previews plugin is responsive and adjusts the number of columns automatically. merefield also provides resources on CSS grid and suggests that daemon should read them to understand how to implement a flexible grid layout.

daemon thanks merefield for the resources and is looking for the proper CSS class to target the list. merefield advises to apply the grid CSS above the item level and copy the way TLP or TLT does it.

daemon decides to use the Topic List Thumbnails plugin and override some styles via CSS. daemon also asks about hiding the register/login buttons for anonymous users and finding a login URL. Canapin provides a login URL and a resource on how to login to Discourse by overriding SSO.

Hi!

I’m currently develop my own “blog” theme and I would like to set the latest view in grid style (like here in the theme category).
I know that there are a few components for this, but I don’t have images in my posts so this looks a bit strange. And there’s no option (for example in the topic-thumbnails component) to set it to 2 or 3 columns (or even flexible).

I tried many things (more or less the site was broken after that :joy: ) but couldn’t figure out how to do this.

Can someone can give a hint on how to solve this? I only need the basic setting for this and afterwards I can “style” it to fit my needs.

Kind regards

PS. If this is the wrong category pls move it. :slightly_smiling_face:

most of things like that can be set up in the CSS through admin > customize > themes > Custom CSS

i also wanted to have two columns and a more narrow view so I reduced the max-width from 1100px (?) to 950px and this also changed from three to two columns - in my case it was this

:root { --d-max-width: 950px; }

Topic list previews is responsive so sets the number of columns automatically. You just squeeze it a little with sidebars (eg with Layouts plugin) and the number of columns number decreases. (See this example https://www.starzen.space - starts out 2 columns but click on a tag and it reverts to 3 columns)

Yes I know that this can be done with css, my whole theme is done with css.
And, I don’t have 1100px, my design is flexible to the screen resolution. And no, I don’t want this ultra small fixed width 1100px. :wink:

@merefield
I tried this theme component a lot, but it’s not was I was looking for. I don’t have images in posts, and it should be flexible with the columns (depends on the screen resolution).

What I am looking for is the css class to turn the list into a grid. :slightly_smiling_face:

It is, that is why there is only one column on mobile.

On 11inch iPad with a single right side-bar, TLP shows two columns in landscape, and one in portrait

This is the key line in TLP:

You should read this:

and this (but I’m not sure ‘resolution’ is what you mean because that can be confused with DPI):

Thank you!

My problem was to find the proper css class from discourse for the list.
Is it topic-list-item or topic-list-item-seperator or anything else.

I will try it later.

The grid CSS needs to be above the item level. Copy the way TLP or TLT does it.

I’m using Topic List Thumbnails now and have overridden a few things via CSS. Didn’t want anything with images in the text but you can use a default image.

Don’t you mean icon?

You don’t have to use images with TLP and you can use a default image.

Yes, of course, a default icon. :wink:

Sorry for the double posting, but I have another question regarding register/login button.

I want to hide these 2 buttons for anon users but then I can’t login too. Is there a URL to a login site or anything similar?

No one?

Is there really no login url?

https://meta.discourse.org/login or

Depending on your login methods and what you want. :slight_smile: