• Hi, This plugin woks with internal Pods Templates?
    i place to my template {@repeat_field} but nothing happens.
    The fields not snowing.
    Thank you.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Coding Panda

    (@codingpanda)

    Yes, it works with internal Pods Templates.

    It is an array so you have to use this template tag: [each related_field_name][/each]

    https://docs.pods.io/displaying-pods/template-tags/each-loop-tag/
    https://www.youtube.com/watch?v=81PkhEOZYb8 at 6:25

    However, it doesn’t work with nested repeater fields. For nested repeater fields, you have to create shortcodes to use in the Pods Templates.

    Thread Starter Christos Vouzas

    (@cvouzas)

    Thank you for the quick answer.
    I have follow all the steps from your video and i don’t now how to show the real fields in front end (not the texts array etc).
    So, how to show the repeatable fields in front end?
    I have a custom pod (to use as repeatable) with one text field as title and one field as photo gallery.
    What code can i use?
    Thank you.

    Plugin Author Coding Panda

    (@codingpanda)

    If it is OK with you, would you export the related pods and post them here, together with the code of your template?

    I need the details to understand the problem better to give an answer.

    Thread Starter Christos Vouzas

    (@cvouzas)

    There is the exported code.

    {
        "meta": {
            "version": "2.8.20",
            "build": 1655749740
        },
        "pods": [
            {
                "name": "hotel_room",
                "id": 35,
                "label": "Hotel Rooms",
                "description": "",
                "type": "pod",
                "storage": "table",
                "label_singular": "Hotel room",
                "public": "1",
                "show_ui": "1",
                "pod_index": "room_name",
                "_migrated_28": "1",
                "unique": "0",
                "ui_style": "post_type",
                "show_in_menu": "0",
                "menu_position": "0",
                "ui_actions_enabled": [
                    "add",
                    "edit",
                    "duplicate",
                    "delete"
                ],
                "ui_reorder_field": "menu_order",
                "ui_fields_manage": [
                    "name",
                    "modified"
                ],
                "required": "0",
                "groups": [
                    {
                        "name": "room_details",
                        "id": 36,
                        "label": "Room Details",
                        "description": "",
                        "weight": 0,
                        "roles_allowed": "administrator",
                        "fields": [
                            {
                                "name": "hotel_room_name",
                                "id": 37,
                                "label": "Room Name",
                                "description": "",
                                "weight": 0,
                                "type": "text",
                                "required": "1",
                                "sister_id": "-- Select One --",
                                "unique": "0",
                                "text_allowed_html_tags": "strong em a ul ol li b i",
                                "text_max_length": "255",
                                "roles_allowed": "administrator"
                            },
                            {
                                "name": "hotel_room_photo",
                                "id": 52,
                                "label": "Room photo",
                                "description": "",
                                "weight": 1,
                                "type": "file",
                                "sister_id": "-- Select One --",
                                "required": "0",
                                "unique": "0",
                                "file_format_type": "single",
                                "file_uploader": "attachment",
                                "file_attachment_tab": "upload",
                                "file_upload_dir": "wp",
                                "file_edit_title": "1",
                                "file_show_edit_link": "0",
                                "file_linked": "0",
                                "file_limit": "0",
                                "file_type": "images",
                                "file_field_template": "rows",
                                "file_add_button": "Add File",
                                "file_modal_title": "Attach a file",
                                "file_modal_add_button": "Add File",
                                "roles_allowed": "administrator"
                            }
                        ]
                    }
                ]
            },
            {
                "name": "hotel",
                "id": 97,
                "label": "Hotels",
                "description": "",
                "type": "post_type",
                "storage": "table",
                "label_singular": "Hotel",
                "public": "1",
                "show_ui": "1",
                "rest_enable": "1",
                "supports_title": "1",
                "supports_editor": "1",
                "_migrated_28": "1",
                "required": "0",
                "unique": "0",
                "show_in_menu": "1",
                "capability_type": "post",
                "capability_type_extra": "1",
                "has_archive": "1",
                "has_archive_slug": "amd_hotels",
                "rewrite": "1",
                "rewrite_custom_slug": "amd_hotel",
                "default_status": "draft",
                "pfat_enable": "1",
                "pfat_single": "Hotels",
                "pfat_append_single": "prepend",
                "pfat_filter_single": "the_content",
                "pfat_archive": "Hotels",
                "pfat_append_archive": "prepend",
                "pfat_filter_archive": "the_excerpt",
                "menu_position": "0",
                "show_in_nav_menus": "1",
                "show_in_admin_bar": "1",
                "menu_name": "Hotels",
                "groups": [
                    {
                        "name": "more_fields",
                        "id": 98,
                        "label": "More Fields",
                        "description": "",
                        "weight": 0,
                        "fields": [
                            {
                                "name": "hotel_name",
                                "id": 99,
                                "label": "Hotel Name",
                                "description": "",
                                "weight": 0,
                                "type": "text",
                                "sister_id": "-- Select One --",
                                "required": "0",
                                "unique": "0",
                                "text_allowed_html_tags": "strong em a ul ol li b i",
                                "text_max_length": "255",
                                "roles_allowed": "administrator",
                                "rest_pick_response": "array",
                                "rest_pick_depth": "1",
                                "text_allow_shortcode": "0"
                            },
                            {
                                "name": "hotel_rooms",
                                "id": 100,
                                "label": "Hotel Rooms",
                                "description": "",
                                "weight": 1,
                                "type": "pandarepeaterfield",
                                "sister_id": "-- Select One --",
                                "required": "0",
                                "unique": "0",
                                "pandarepeaterfield_table": "hotel_room",
                                "pandarepeaterfield_field_width": "100",
                                "pandarepeaterfield_entry_limit": "0",
                                "pandarepeaterfield_enable_load_more": "0",
                                "pandarepeaterfield_initial_amount": "10",
                                "pandarepeaterfield_enable_trash": "0",
                                "pandarepeaterfield_order_by": "pandarf_order",
                                "pandarepeaterfield_order": "ASC",
                                "pandarepeaterfield_display_order_info": "0",
                                "pandarepeaterfield_apply_admin_columns": "0",
                                "pandarepeaterfield_allow_reassign": "0",
                                "pandarepeaterfield_public_access": "0",
                                "roles_allowed": "administrator",
                                "rest_pick_response": "array",
                                "rest_pick_depth": "1"
                            }
                        ]
                    }
                ]
            }
        ],
        "templates": [
            {
                "name": "Hotels",
                "code": "{@hotel_name}\r\n{@hotel_rooms}",
                "id": 43,
                "_edit_last": "1",
                "_edit_lock": "1655749278:1",
                "pod_reference": {
                    "pod": "hotels"
                }
            }
        ]
    }
    Plugin Author Coding Panda

    (@codingpanda)

    OK. Please add this code to your template

    <h1>{@hotel_name}</h1>
    
    [each hotel_rooms]
    <h2>{@hotel_room_name}</h2>		
    
    <img src="[get_image_src id='{@hotel_room_photo}' size='large']"/>
    
    [/each]

    Add the following to your functions.php

    add_shortcode( 'get_image_src', 'get_image_src' );
    
    function get_image_src( $attrs ){
    	
    	$attrs = shortcode_atts( array(
    		'id' => 0,		
    		'size' => 'large'
    		
    	), $attrs );
    	$img_src = wp_get_attachment_image_src( $attrs['id'], $attrs['size'] );
    	if( ! empty( $img_src ) ){
    		return $img_src[0];
    	}
    	return '';
    }

    Hope they make sense to you.

    Thread Starter Christos Vouzas

    (@cvouzas)

    You are life saver. It works great.
    Thank you very much.
    One more thing place (the last one). If i want to change the photo to photo galley to add more than one photo?
    What changes must make to the code?
    Thank you.

    Thread Starter Christos Vouzas

    (@cvouzas)

    {
    “meta”: {
    “version”: “2.8.20”,
    “build”: 1655815538
    },
    “pods”: [
    {
    “name”: “hotel_room”,
    “id”: 35,
    “label”: “Hotel Rooms”,
    “description”: “”,
    “type”: “pod”,
    “storage”: “table”,
    “label_singular”: “Hotel room”,
    “public”: “1”,
    “show_ui”: “1”,
    “pod_index”: “room_name”,
    “_migrated_28”: “1”,
    “unique”: “0”,
    “ui_style”: “post_type”,
    “show_in_menu”: “0”,
    “menu_position”: “0”,
    “ui_actions_enabled”: [
    “add”,
    “edit”,
    “duplicate”,
    “delete”
    ],
    “ui_reorder_field”: “menu_order”,
    “ui_fields_manage”: [
    “name”,
    “modified”
    ],
    “required”: “0”,
    “groups”: [
    {
    “name”: “room_details”,
    “id”: 36,
    “label”: “Room Details”,
    “description”: “”,
    “weight”: 0,
    “roles_allowed”: “administrator”,
    “fields”: [
    {
    “name”: “hotel_room_name”,
    “id”: 37,
    “label”: “Room Name”,
    “description”: “”,
    “weight”: 0,
    “type”: “text”,
    “required”: “1”,
    “sister_id”: “– Select One –“,
    “unique”: “0”,
    “text_allowed_html_tags”: “strong em a ul ol li b i”,
    “text_max_length”: “255”,
    “roles_allowed”: “administrator”
    },
    {
    “name”: “room_details”,
    “id”: 107,
    “label”: “Room Details”,
    “description”: “”,
    “weight”: 1,
    “type”: “wysiwyg”,
    “sister_id”: “– Select One –“,
    “required”: “0”,
    “unique”: “0”,
    “wysiwyg_editor”: “tinymce”,
    “roles_allowed”: “administrator”
    },
    {
    “name”: “hotel_room_photo”,
    “id”: 52,
    “label”: “Room photo”,
    “description”: “”,
    “weight”: 2,
    “type”: “file”,
    “sister_id”: “– Select One –“,
    “required”: “0”,
    “unique”: “0”,
    “file_format_type”: “multi”,
    “file_uploader”: “attachment”,
    “file_attachment_tab”: “browse”,
    “file_upload_dir”: “wp”,
    “file_edit_title”: “1”,
    “file_show_edit_link”: “0”,
    “file_linked”: “1”,
    “file_limit”: “0”,
    “file_type”: “images”,
    “file_field_template”: “tiles”,
    “file_add_button”: “Add File”,
    “file_modal_title”: “Attach a file”,
    “file_modal_add_button”: “Add File”,
    “roles_allowed”: “administrator”,
    “file_wp_gallery_output”: “1”,
    “file_wp_gallery_link”: “file”,
    “file_wp_gallery_columns”: “4”,
    “file_wp_gallery_size”: “medium”
    }
    ]
    }
    ]
    },
    {
    “name”: “hotel”,
    “id”: 97,
    “label”: “Hotels”,
    “description”: “”,
    “type”: “post_type”,
    “storage”: “table”,
    “label_singular”: “Hotel”,
    “public”: “1”,
    “show_ui”: “1”,
    “rest_enable”: “1”,
    “supports_title”: “1”,
    “supports_editor”: “1”,
    “_migrated_28”: “1”,
    “required”: “0”,
    “unique”: “0”,
    “show_in_menu”: “1”,
    “capability_type”: “post”,
    “capability_type_extra”: “1”,
    “has_archive”: “1”,
    “has_archive_slug”: “amd_hotels”,
    “rewrite”: “1”,
    “rewrite_custom_slug”: “amd_hotel”,
    “default_status”: “draft”,
    “pfat_enable”: “1”,
    “pfat_single”: “Hotels”,
    “pfat_append_single”: “prepend”,
    “pfat_filter_single”: “the_content”,
    “pfat_archive”: “Hotels”,
    “pfat_append_archive”: “prepend”,
    “pfat_filter_archive”: “the_excerpt”,
    “menu_position”: “0”,
    “show_in_nav_menus”: “1”,
    “show_in_admin_bar”: “1”,
    “menu_name”: “Hotels”,
    “groups”: [
    {
    “name”: “more_fields”,
    “id”: 98,
    “label”: “More Fields”,
    “description”: “”,
    “weight”: 0,
    “fields”: [
    {
    “name”: “hotel_name”,
    “id”: 99,
    “label”: “Hotel Name”,
    “description”: “”,
    “weight”: 0,
    “type”: “text”,
    “sister_id”: “– Select One –“,
    “required”: “0”,
    “unique”: “0”,
    “text_allowed_html_tags”: “strong em a ul ol li b i”,
    “text_max_length”: “255”,
    “roles_allowed”: “administrator”,
    “rest_pick_response”: “array”,
    “rest_pick_depth”: “1”,
    “text_allow_shortcode”: “0”
    },
    {
    “name”: “hotel_rooms”,
    “id”: 100,
    “label”: “Hotel Rooms”,
    “description”: “”,
    “weight”: 1,
    “type”: “pandarepeaterfield”,
    “sister_id”: “– Select One –“,
    “required”: “0”,
    “unique”: “0”,
    “pandarepeaterfield_table”: “hotel_room”,
    “pandarepeaterfield_field_width”: “100”,
    “pandarepeaterfield_entry_limit”: “0”,
    “pandarepeaterfield_enable_load_more”: “0”,
    “pandarepeaterfield_initial_amount”: “10”,
    “pandarepeaterfield_enable_trash”: “0”,
    “pandarepeaterfield_order_by”: “pandarf_order”,
    “pandarepeaterfield_order”: “ASC”,
    “pandarepeaterfield_display_order_info”: “0”,
    “pandarepeaterfield_apply_admin_columns”: “0”,
    “pandarepeaterfield_allow_reassign”: “0”,
    “pandarepeaterfield_public_access”: “0”,
    “roles_allowed”: “administrator”,
    “rest_pick_response”: “array”,
    “rest_pick_depth”: “1”
    }
    ]
    }
    ]
    }
    ],
    “templates”: [
    {
    “name”: “Hotels”,
    “code”: “<h1>{@hotel_name}<\/h1>\r\n\r\n[each hotel_rooms]\r\n<h2>{@hotel_room_name}<\/h2>\t\r\n<p>{@room_details}<\/p>\r\n\r\n[\/each]”,
    “id”: 43,
    “_edit_last”: “1”,
    “_edit_lock”: “1655815390:1”,
    “pod_reference”: {
    “pod”: “hotel_room”
    }
    }
    ]
    }

    Plugin Author Coding Panda

    (@codingpanda)

    Hi @cvouzas

    The code can’t be processed.

    Would you please wrap your code by using the CODE button?

    Thread Starter Christos Vouzas

    (@cvouzas)

    `{
    “meta”: {
    “version”: “2.8.20”,
    “build”: 1655821470
    },
    “pods”: [
    {
    “name”: “hotel_room”,
    “id”: 35,
    “label”: “Hotel Rooms”,
    “description”: “”,
    “type”: “pod”,
    “storage”: “table”,
    “label_singular”: “Hotel room”,
    “public”: “1”,
    “show_ui”: “1”,
    “pod_index”: “room_name”,
    “_migrated_28”: “1”,
    “unique”: “0”,
    “ui_style”: “post_type”,
    “show_in_menu”: “0”,
    “menu_position”: “0”,
    “ui_actions_enabled”: [
    “add”,
    “edit”,
    “duplicate”,
    “delete”
    ],
    “ui_reorder_field”: “menu_order”,
    “ui_fields_manage”: [
    “name”,
    “modified”
    ],
    “required”: “0”,
    “groups”: [
    {
    “name”: “room_details”,
    “id”: 36,
    “label”: “Room Details”,
    “description”: “”,
    “weight”: 0,
    “roles_allowed”: “administrator”,
    “fields”: [
    {
    “name”: “hotel_room_name”,
    “id”: 37,
    “label”: “Room Name”,
    “description”: “”,
    “weight”: 0,
    “type”: “text”,
    “required”: “1”,
    “sister_id”: “– Select One –“,
    “unique”: “0”,
    “text_allowed_html_tags”: “strong em a ul ol li b i”,
    “text_max_length”: “255”,
    “roles_allowed”: “administrator”
    },
    {
    “name”: “room_details”,
    “id”: 107,
    “label”: “Room Details”,
    “description”: “”,
    “weight”: 1,
    “type”: “wysiwyg”,
    “sister_id”: “– Select One –“,
    “required”: “0”,
    “unique”: “0”,
    “wysiwyg_editor”: “tinymce”,
    “roles_allowed”: “administrator”
    },
    {
    “name”: “hotel_room_photo”,
    “id”: 52,
    “label”: “Room photo”,
    “description”: “”,
    “weight”: 2,
    “type”: “file”,
    “sister_id”: “– Select One –“,
    “required”: “0”,
    “unique”: “0”,
    “file_format_type”: “multi”,
    “file_uploader”: “attachment”,
    “file_attachment_tab”: “browse”,
    “file_upload_dir”: “wp”,
    “file_edit_title”: “1”,
    “file_show_edit_link”: “0”,
    “file_linked”: “1”,
    “file_limit”: “0”,
    “file_type”: “images”,
    “file_field_template”: “tiles”,
    “file_add_button”: “Add File”,
    “file_modal_title”: “Attach a file”,
    “file_modal_add_button”: “Add File”,
    “roles_allowed”: “administrator”,
    “file_wp_gallery_output”: “1”,
    “file_wp_gallery_link”: “file”,
    “file_wp_gallery_columns”: “4”,
    “file_wp_gallery_size”: “medium”
    }
    ]
    }
    ]
    },
    {
    “name”: “hotel”,
    “id”: 97,
    “label”: “Hotels”,
    “description”: “”,
    “type”: “post_type”,
    “storage”: “table”,
    “label_singular”: “Hotel”,
    “public”: “1”,
    “show_ui”: “1”,
    “rest_enable”: “1”,
    “supports_title”: “1”,
    “supports_editor”: “1”,
    “_migrated_28”: “1”,
    “required”: “0”,
    “unique”: “0”,
    “show_in_menu”: “1”,
    “capability_type”: “post”,
    “capability_type_extra”: “1”,
    “has_archive”: “1”,
    “has_archive_slug”: “amd_hotels”,
    “rewrite”: “1”,
    “rewrite_custom_slug”: “amd_hotel”,
    “default_status”: “draft”,
    “pfat_enable”: “1”,
    “pfat_single”: “Hotels”,
    “pfat_append_single”: “prepend”,
    “pfat_filter_single”: “the_content”,
    “pfat_archive”: “Hotels”,
    “pfat_append_archive”: “prepend”,
    “pfat_filter_archive”: “the_excerpt”,
    “menu_position”: “0”,
    “show_in_nav_menus”: “1”,
    “show_in_admin_bar”: “1”,
    “menu_name”: “Hotels”,
    “groups”: [
    {
    “name”: “more_fields”,
    “id”: 98,
    “label”: “More Fields”,
    “description”: “”,
    “weight”: 0,
    “fields”: [
    {
    “name”: “hotel_name”,
    “id”: 99,
    “label”: “Hotel Name”,
    “description”: “”,
    “weight”: 0,
    “type”: “text”,
    “sister_id”: “– Select One –“,
    “required”: “0”,
    “unique”: “0”,
    “text_allowed_html_tags”: “strong em a ul ol li b i”,
    “text_max_length”: “255”,
    “roles_allowed”: “administrator”,
    “rest_pick_response”: “array”,
    “rest_pick_depth”: “1”,
    “text_allow_shortcode”: “0”
    },
    {
    “name”: “hotel_rooms”,
    “id”: 100,
    “label”: “Hotel Rooms”,
    “description”: “”,
    “weight”: 1,
    “type”: “pandarepeaterfield”,
    “sister_id”: “– Select One –“,
    “required”: “0”,
    “unique”: “0”,
    “pandarepeaterfield_table”: “hotel_room”,
    “pandarepeaterfield_field_width”: “100”,
    “pandarepeaterfield_entry_limit”: “0”,
    “pandarepeaterfield_enable_load_more”: “0”,
    “pandarepeaterfield_initial_amount”: “10”,
    “pandarepeaterfield_enable_trash”: “0”,
    “pandarepeaterfield_order_by”: “pandarf_order”,
    “pandarepeaterfield_order”: “ASC”,
    “pandarepeaterfield_display_order_info”: “0”,
    “pandarepeaterfield_apply_admin_columns”: “0”,
    “pandarepeaterfield_allow_reassign”: “0”,
    “pandarepeaterfield_public_access”: “0”,
    “roles_allowed”: “administrator”,
    “rest_pick_response”: “array”,
    “rest_pick_depth”: “1”
    }
    ]
    }
    ]
    }
    ],
    “templates”: [
    {
    “name”: “Hotels”,
    “code”: “<h1>{@hotel_name}<\/h1>\r\n\r\n[each hotel_rooms]\r\n<h2>{@hotel_room_name}<\/h2>\t\r\n<p>{@room_details}<\/p>\r\n<img src=\”[get_image_src id='{@hotel_room_photo}’ size=’medium’]\”\/>\r\n[\/each]”,
    “id”: 43,
    “_edit_last”: “1”,
    “_edit_lock”: “1655815390:1”,
    “pod_reference”: {
    “pod”: “hotel_room”
    }
    }
    ]
    }

    Plugin Author Coding Panda

    (@codingpanda)

    Thanks for pasting it again. I can see you opened it with the CODE quotation but didn’t close it with another CODE quotation, it still doesn’t work. Would you please try again?

    Plugin Author Coding Panda

    (@codingpanda)

    Never mind. I figured out how to fix it.

    It returns the image ids with commas, e.g. 1,2,3

    You can change the get_image_src shortcode to explode the ids and process each image, or you can use the WordPress gallery shortcode: https://codex.wordpress.org/Gallery_Shortcode

    <h1>{@hotel_name}</h1>
    
    [each hotel_rooms]
    <h2>{@hotel_room_name}</h2>	
    <p>{@room_details}</p>
    [gallery ids="{@hotel_room_photo}"]
    
    [/each]
    Thread Starter Christos Vouzas

    (@cvouzas)

    I’m late, I know. jus i want to say THANK YOU very much.
    Everything worked fine.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘This plugin woks with internal Pods Templates?’ is closed to new replies.