[Resolved] Page Layout Best Practice (GP+GB)

Home Forums Support [Resolved] Page Layout Best Practice (GP+GB)

Home Forums Support Page Layout Best Practice (GP+GB)

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1586194
    Joel

    Hello,

    I’ve been playing about with the various layout options using the customiser, layout elements etc. And I was wondering what the best practice was for doing this if generally we will be using GB for content?

    Let’s say I want the content to generally be contained to 1200px but there will be some full width sections (e.g. for backgrounds, banner images etc).

    Is it better to create a layout element at full width and use GB to contain the content (when I tried this it didn’t seem to affect existing pages, is that the expected behaviour?).

    Or is it better to use the customiser to contain the content to 1200px and only enable full width when needed?

    And following on from that, is it possible to set default padding for the GB container block because at the moment it adds 40px each side so the content doesn’t align with other content like the header etc?

    Thanks

    #1586458
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This really depends on preference. Some people like to set each individual block to full-width, but I don’t love the code that’s necessary for it to break free of the parent container.

    Personally, I prefer to start with a full-width page, and then add contained blocks as needed. The Container block in GB will automatically use the Container Width set by GP in the Customizer if you don’t change it.

    For the padding, you can do this:

    add_filter( 'generateblocks_defaults', function( $defaults ) {
        $defaults['container']['paddingTop'] = '40';
        $defaults['container']['paddingRight'] = '40';
        $defaults['container']['paddingBottom'] = '40';
        $defaults['container']['paddingLeft'] = '40';
    
        return $defaults;
    } );

    Hope this helps!

    #1587473
    Joel

    That’s great, thanks for your help

    #1587500
    Joel

    Sorry just had another thought…is it possible to set the Content Container default to ‘Full Width’? And then change it to ‘Default’ on a few pages as needed? I know I can set up a Full Width Layout Element and exclude certain pages but I’m wondering whether this could be done in the editor for colleagues who may not have access to GP settings.

    Thanks again.

    #1587663
    Leo
    Staff
    Customer Support

    is it possible to set the Content Container default to ‘Full Width’? And then change it to ‘Default’ on a few pages as needed? I know I can set up a Full Width Layout Element and exclude certain pages but I’m wondering whether this could be done in the editor for colleagues who may not have access to GP settings.

    Unfortunately that’s not possible – it would need to be excluded within the layout element.

    #1588895
    Joel

    Ok, thank you

    #1589988
    Leo
    Staff
    Customer Support
    #1593002
    Joel

    Sorry one more follow up question, is there any way of setting the GB padding defaults to change based on the Content Container selection? Ideally I would like the default padding for left and right to be 0 if the “Default” Content Container is selected, and it to be 40 if the “Full Width” Content Container is selected.

    Thanks again and Happy Christmas!

    #1593464
    Leo
    Staff
    Customer Support

    You can only set the default as Tom pointed out above but not possible to set it conditionally.

    #1593503
    Joel

    Ok thanks, would be a nice feature!

    #1593519
    Leo
    Staff
    Customer Support

    I would say that it’s very rare to set the content container to default when GB is used.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.