Grid layout

Ehren

Administrator
Staff member
Customer
Messages
5,040
Website
www.xenfocus.com
If you'd like to display your forums in a grid layout, browse to Style Properties > Xenfocus: Grid layout and enable Grid view.

A toggle will appear in the front-end Theme Editor, allowing your members to switch back to a table layout if they wish (assuming you've given them permission under Xenfocus: Theme Editor).

If you've enabled the "Wallpaper design" setting under the "Grid layout" style properties, you can now add background-images to your nodes.

To do this, you'll first need to know the id of your node. If you don't know the id, you can find it by browsing to ACP > Forums > Nodes. Click on a node, and the URL will show you the id. For example:
Code:
admin.php?forums/tutorials.33/edit

With this in mind, add the following to your extra.less file, replacing 33 with your own node id and change the URL to your own image.
CSS:
.focus-grid .block--category .node--id33 .node-body {
    background-image: url('styles/xenfocus/global/node-wallpapers/33.jpg');
}

Repeat that code for each node/background image and you're done!
 

Attachments

  • node-id.png
    node-id.png
    36.4 KB · Views: 417
Last edited:

Ehren

Administrator
Staff member
Customer
Messages
5,040
Website
www.xenfocus.com
To enable the grid layout when viewing subforums on a topic list:

1. Open the forum_view template file and find:
Code:
    <xf:ad position="forum_view_above_node_list" arg-forum="{$forum}" />
    <div class="block">

2. Change to:
Code:
    <xf:ad position="forum_view_above_node_list" arg-forum="{$forum}" />
    <div class="block block--category">
 

Ehren

Administrator
Staff member
Customer
Messages
5,040
Website
www.xenfocus.com
Hello,

The grid settings are available in every Xenfocus theme. Make sure you're not trying to achieve the same thing on a theme from a different designer since the settings won't be there.

Screen Shot 2019-12-04 at 8.15.02 am.png
 

Escanor

New Member
Messages
2
1864

1865

1866

These are the style properties I have, I guess I did something wrong when installing my Theme? I have the Uniform Pro theme, thank you!
 

Ehren

Administrator
Staff member
Customer
Messages
5,040
Website
www.xenfocus.com
Heyy!

This is untested, but does adding this to extra.less help?
Less:
// Assign node wallpapers
<xf:if is="property('xenfocus_gridImage') AND property('xenfocus_gridWallpaper')">

    @supports (display: grid){
        .focus-grid{
            .block--category{               
                .node--id5 .node-body {
                    background-image: url('https://site.com/image.jpg');
                }
                .node--id9 .node-body {
                    background-image: url('https://site.com/image.jpg');
                }
                .node--id15 .node-body {
                    background-image: url('https://site.com/image.jpg');
                }
            }
        }
    }

</xf:if>
 

AlteredFancy

New Member
Messages
12
Website
poissondore.fr
Heyy!

This is untested, but does adding this to extra.less help?
Less:
// Assign node wallpapers
<xf:if is="property('xenfocus_gridImage') AND property('xenfocus_gridWallpaper')">

    @supports (display: grid){
        .focus-grid{
            .block--category{              
                .node--id5 .node-body {
                    background-image: url('https://site.com/image.jpg');
                }
                .node--id9 .node-body {
                    background-image: url('https://site.com/image.jpg');
                }
                .node--id15 .node-body {
                    background-image: url('https://site.com/image.jpg');
                }
            }
        }
    }

</xf:if>
Less:
// Assign node wallpapers
<xf:if is="property('xenfocus_gridImage') AND property('xenfocus_gridWallpaper')">

    @supports (display: grid){
        .focus-grid{
            .block--category{               
                .node--id15 .node-body {
                    background-image: url('https://contenu.poissondore.fr/img/wallpaper/1.jpg');
                }
                .node--id6 .node-body {
                    background-image: url('https://contenu.poissondore.fr/img/wallpaper/2.jpg');
                }
            }
        }
    }

</xf:if>
For some reason it does not work :unsure:
 

AlteredFancy

New Member
Messages
12
Website
poissondore.fr
All fixed :)

If possible, I'd recommend using smaller images for your backgrounds. They're currently 1500x844 pixels in size, but the actual node is only 560x66.
Thank you so much :love: Give me a paypal address, Ill give you a tip! How did you managed to fix it by the way?
EDIT: I've seen that you've just removed the xf & support lines ;)
 
Last edited:
Top