[Support request] Block element: incorrect display of a post grid

Home Forums Support [Support request] Block element: incorrect display of a post grid

Home Forums Support Block element: incorrect display of a post grid

  • This topic has 5 replies, 2 voices, and was last updated 2 months ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2244746
    Marc

    Hello, on a website I have posts with certain keywords. Now I want to show a post grid on all posts below the main content (Hook: generate_after_content), which displays teasers of posts that also have the respective keyword.

    For the grid display of the teasers I use the plugin Spectra (fka “Ultimate Addons for Gutenberg”) from Brainstorm Force.

    If I only include this grid directly below the post content in the post, everything works perfectly (https://prnt.sc/FnkZ73XtxvEu).

    Now I tried to create a block under Elements that includes this grid. Then I set the rule that this block will be output on all posts that also have the same keyword. Technically this works fine, but unfortunately the grid is output unformatted or incorrectly formatted.

    If I include the grid (as a test) both in the post and as an element block below the content, then the teasers are output in columns, but without further formatting.

    If I include the grid in a post only via the element block, then the teasers are output completely unformatted (https://prnt.sc/cLzpxAu1EneW).

    How do I make it so that I include the grid only once as a block element and that the teasers are displayed properly formatted?

    Thank you very much for a tip!

    Marc

    #2244818
    David
    Staff
    Customer Support

    Hi there,

    i believe UAG parses the post content to see whether its blocks are present. But it won’t know of the Elements post type so won’t render its CSS. Another user had a similar issue – see reply with the filter required to tell the plugin what other post types to look for:

    https://generatepress.com/forums/topic/issue-with-adding-ultimate-addons-for-gutenberg/#post-2020164

    Alternatively we’re real close to releasing GB 1.5 which has its own Query Loop block, you may want to check that out:

    https://generateblocks.com/generateblocks-1-5-dynamic-data-query-loops-image-blocks/

    #2244911
    Marc

    Hi David, thanks a lot for your tips. I have installed the filter, unfortunately the formatting still doesn’t work….

    I have included this code in the functions.php of my child theme:

    
    add_action( 'wp_enqueue_scripts', 'enqueue_scripts_by_post_id' );
    
    function enqueue_scripts_by_post_id() {
    
        if ( 'post' == get_post_type() ) {
            $post_id = get_the_id();
            // Create Instance. Pass the Post ID.
            $post_assets_instance = new UAGB_Post_Assets( $post_id );
    
            // Enqueue the Assets.
            $post_assets_instance->enqueue_scripts();
    
        }
        
    }
    

    This has not changed the representation of the grid. Example: http://neu.wasserkuppe.net/wandern/ -> the Grid should be shown below the “Weitere Angebote” heading.

    Do you have any idea what I did wrong?

    Thanks again a lot and sunny greetings,

    Marc

    #2244981
    David
    Staff
    Customer Support

    Yeah i am not sure how that function is meant to work.
    Could you check with UAGB Support ?

    #2244983
    Marc

    All right no problem, I’ll do that!

    Thank you and have a nice day, Marc

    #2245220
    David
    Staff
    Customer Support

    Let us know how you get on, or if they need any info from us.

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