Coding Panda
Forum Replies Created
-
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Unknown columnIt looks like the repeater field’s columns are not available. Is it possible to export the related Pods for me to investigate?
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Repeater only or mix?Yes, it is possible. Please follow the videos. The videos are for an old version of Pods, but the principle still applies.
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Supported Gutenberg Blocks pluginsApologies, due to various data saved in the repeater field, there is currently no frontend display available.
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibilityOK. Thanks.
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibility?? Brilliant.
I will look into it when I am less busy.
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibilityI noticed a mistake. Please update the function this this:
function display_book_chapters( $args ){ if( isset( $args['id'] ) ){ $chapters = pods_field( 'book', $args['id'], 'chapter' ); if( ! empty( $chapters ) ){ 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>' ; } } } }
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibilityIs 336 an ID of a book page?
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibilityYou can update the function to check if the chapters are available.
function display_book_chapters( $id ){ $chapters = pods_field( 'book', $id, 'chapter' ); if( ! empty( $chapters ) ){ 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>' ; } } }
I think the problem is that {post_id} doesn’t pass in the correct post id into the shortcode. You can test it by echoing {post_id} without the shortcode, and contact Bricks if necessary.
I don’t think $post_id can be used before declaring it. You could try {post_id}.
the Repeater is not a post type. It is a field of a Pod which can be a post type.
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibilityUse it in the template: [display_book_chapters id={post_id}]
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibilityI 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.
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibility@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?
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibilityThanks for the detailed instructions. Can it be a shortcode in functions.php, and then add the shortcode to the template?
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibility@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?
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibilityHi, @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?
Forum: Plugins
In reply to: [Panda Pods Repeater Field] Bricks Builder compatibilityI can try. How do you want to use the plugin? Backend or Frontend?