Bricks Builder compatibility
-
I’m trying to make the contents of a repeater appear in bricks, without success. Does anyone have any tips or guides?
-
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.Hi, @dizplay. Thanks for being interested in the plugin. I understand, but Bricks is not free.
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.
I can try. How do you want to use the plugin? Backend or Frontend?
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.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?
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.@dizplay Sorry, I don’t to want publish an admin login details. I need more instructions. Do I do these:
- Create an advance content type for the repeater field (what is the name of the advance content type?)
- Create a table based Book post type
- Create a panda repeater field to use the advance content type
Which page do I need to edit?
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)Thanks for the detailed instructions. Can it be a shortcode in functions.php, and then add the shortcode to the template?
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/
@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?
{post_id} is correct. Be sure to be previewing the real post, and not the template.
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.
Use it in the template: [display_book_chapters id={post_id}]
- The topic ‘Bricks Builder compatibility’ is closed to new replies.