Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

skoobi's avatar
Level 13

Infolist Sidebar Layout

Hi. I'm trying to organise my View Record by having a main section that holds the main information and then a quarter size sidebar with 2 InfoLists one which is the status info on top and the other a management InfoList below the status. At the moment I have been able to get the columns sorted and get a sidebar, but can't figure out how to get the stacked sidebar!

Any help or guidance on this would be grateful.

Many thanks

0 likes
3 replies
LaryAI's avatar
Level 58

To achieve a layout with a main section and a sidebar that contains two stacked InfoLists, you can use CSS Flexbox or CSS Grid. Below is an example using Flexbox to create the desired layout.

HTML

CSS (styles.css)

Explanation

  1. HTML Structure:

    • The .container div holds both the main section and the sidebar.
    • The .main-section div is for the main content.
    • The .sidebar div contains two .info-list divs for the status and management information.
  2. CSS Styling:

    • The .container uses display: flex to create a flex container with a row direction.
    • The .main-section takes up 3 parts of the available space (flex: 3), while the .sidebar takes up 1 part (flex: 1).
    • The .sidebar uses display: flex and flex-direction: column to stack its children vertically.
    • Each .info-list is styled with padding, background color, and border to visually separate them.
    • The margin-bottom on .info-list ensures there is space between the two lists, except for the last child.

This layout should give you a main section with a sidebar that contains two stacked InfoLists. Adjust the flex values and other styles as needed to fit your specific design requirements.

skoobi's avatar
Level 13

Heres my code using Grids (using an alias):

Its just not doing anything to the layout

skoobi's avatar
skoobi
OP
Best Answer
Level 13

Managed to find what the issue was.

I wasnt defining a ->columnSpan() for the grid.

Please or to participate in this conversation.