• Resolved dizplay

    (@dizplay)


    I’m trying to make the contents of a repeater appear in bricks, without success. Does anyone have any tips or guides?

Viewing 15 replies - 1 through 15 (of 25 total)
  • Thread Starter dizplay

    (@dizplay)

    I see that the plugin unfortunately isn’t compatible with bricks query loop (PODS is, the plugin not).
    as Bricks is becoming the ultimate web design tool, it would be interesting to make this gem of a plugin compatible.

    Plugin Author Coding Panda

    (@codingpanda)

    Hi, @dizplay. Thanks for being interested in the plugin. I understand, but Bricks is not free.

    Thread Starter dizplay

    (@dizplay)

    If you ask the Bricks team, they probably will give you a license number valid for your development. They already did with other plugin devs.

    Plugin Author Coding Panda

    (@codingpanda)

    I can try. How do you want to use the plugin? Backend or Frontend?

    Thread Starter dizplay

    (@dizplay)

    Both.
    The issue is that when creating a query loop on backend, the Type won’t show the panda repeater, but only Posts, terms and users.
    Other plugin (like ACF, Metabox, ACPT) displays also the repeater field in this dropdown.
    So, Pods is ok, and your plugin it’s even better, it lacks only to be available here.

    Plugin Author Coding Panda

    (@codingpanda)

    Hi, @dizplay. OK. Thanks to Bricks, I got a copy. I am new to Bricks. How do I get to that screen? Do you have a pods json package for me to import?

    Thread Starter dizplay

    (@dizplay)

    FANTASTIC NEWS! Bricks guys are really awesome.
    if you pm me temp admin, I’ll create a tipical scenario.

    Or you can create the usual Books post type in Pods, with a panda repeater on it, with some images and links in a repeater for a single book.
    Then have a look here https://academy.bricksbuilder.io/article/query-loop/
    Basically on frontend you should create a container with some dynamic data on it (the Flash icon on fields)
    Like the picture on previous message, Activating the query loop (on the container element that should be repeated) on the post type dropdown you should have also the repeater, if present on the page.

    Plugin Author Coding Panda

    (@codingpanda)

    @dizplay Sorry, I don’t to want publish an admin login details. I need more instructions. Do I do these:

    1. Create an advance content type for the repeater field (what is the name of the advance content type?)
    2. Create a table based Book post type
    3. Create a panda repeater field to use the advance content type

    Which page do I need to edit?

    Thread Starter dizplay

    (@dizplay)

    Install Pods and Panda.
    Enable “Advanced content type” and ‘Tablke storage’ as per yours tutorials.

    This is a JSON structure for a custom post type called Books
    https://pastebin.com/gthr7y7s
    import it on Pods.


    in WP admin open Bricks > template, create a new template for SINGLE page, click “edit” it with bricks, copy the pastebin code from https://pastebin.com/grhu5xqh and paste it on the paste icon on the top of the structure panel (right darkgray column on bricks editor interface).
    With template open, click the cog on the left top and assign the template to the “Books” post type (see here https://i.imgur.com/G6lgBdP.png)


    last: create a Book post: on More fields you will find some singolar content (Singolar image, title, gallery) and after a repeader group, with Name and PDF).

    Fill the singular content and a couple of Chapters (mine https://i.imgur.com/Jb1flDw.png )

    After that you can view the book public page (it uses the book template).

    So, the issue is that on template, the Post type do not show the repeater group (to count how many repeated groups and multiply the relative div on frontend)

    Plugin Author Coding Panda

    (@codingpanda)

    Thanks for the detailed instructions. Can it be a shortcode in functions.php, and then add the shortcode to the template?

    Thread Starter dizplay

    (@dizplay)

    During editing the template (bricks interface) you find the Shortcode element on the left colum. Click it and position it where you like on the page. When is selected you see its properties, where you can write the classic Shortcode with square brackets.

    It’s also possible to use the echo php command: https://academy.bricksbuilder.io/article/dynamic-data/

    Plugin Author Coding Panda

    (@codingpanda)

    @dizplay I tried to pass the post id into the shortcode, but {post_id} always returns 1. Do you know how to get the current page ID?

    Thread Starter dizplay

    (@dizplay)

    {post_id} is correct. Be sure to be previewing the real post, and not the template.

    Plugin Author Coding Panda

    (@codingpanda)

    I couldn’t get the correct post_id to pass into the shortcode. You know Bricks, would you give it a go? Here is the shortcode:

    
    function display_book_chapters( $id ){ 
    
    	$chapters = pods_field( 'book', $id, 'chapter' ); 
    	
    	foreach( $chapters as $i => $chapter ){
    		echo '<div>';
    		echo $chapter['name'];
    		$pdf_url = wp_get_attachment_url( $chapter['pdf'] );
    		if( $pdf_url ){
    			echo '<a href="' . $pdf_url . '">PDF</a>';
    		}
    		echo '</div>' ;
    	}	
    	
    }
    
    add_shortcode( 'display_book_chapters', 'display_book_chapters' );

    Use it in the template:

    [display_book_chapters id={post_id}]
    • This reply was modified 1 year, 5 months ago by Coding Panda.
    Plugin Author Coding Panda

    (@codingpanda)

    Use it in the template: [display_book_chapters id={post_id}]

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Bricks Builder compatibility’ is closed to new replies.