Help Center

How to Display a Video in a Listing Template for a Repeater Field

Discover how to display YouTube videos saved in JetEngine’s Repeater meta fields on a Single Post page using a grid layout on your WordPress site.

Before you start, check the tutorial requirements:

  • Elementor (Free version) or Block editor (Gutenberg)

  • JetEngine plugin installed and activated

If each of your custom posts contains a list of videos, you can display them using the JetEngine Listing Grid. This is achieved by leveraging the Dynamic Field in combination with a “Repeater” meta field-based Listing. Below is a detailed breakdown of the implementation process.

Backend Preparations

Create a Repeater meta field

You can create a “Repeater” custom field in two ways. The first one is to add it via the Meta Box to post types, taxonomies, users, or WooCommerce products.

The second one is to add a “Repeater” meta field directly to a Custom Post Type.

For example, we proceed to the WordPress Dashboard > JetEngine > Post Types and edit the “JetPlugins tutorials” CPT.

Then, we scroll down to the Meta fields tab and press the “New Meta Field” button. We fill in the Label and Name/ID, and select the “Repeater” Field type.

Next, we click the “New Repeater Field” button. We fill in the Label and Name and choose the “Text” Type. In the following step, we’ll be able to add YouTube video URLs to this “Text” field. These URLs will later be embedded and displayed within a listing.

After that, you can add as many fields to the “Repeater” as required and save the CPT by clicking the “Add/Update PostType” button.

text field for YouTube URL within the repeater field

Complete Repeater fields within posts

Now edit each of your posts in your CPT, and paste the links to the videos into the “Repeater” fields.

video in repeater field

Managing the Listing Template

New Listing for Repeater source

Go to WordPress Dashboard > JetEngine > Listings/Components and hit the Add New Item” button.

We select the “Repeater Field” as the Listing source and adjust the next parameters:

repeater field listing settings
  • From post type — here, we select our CPT for which we created the “Repeater” field;
  • Repeater source — contains three options:
    • JetEngine — if you created a “Repeater” meta field via JetEngine;
    • JetEngine Options Page — if you want to pull data from the previously created Options Page in JetEngine
    • ACF — if you created a “Repeater” meta field via the ACF plugin.
  • Repeater field — specify the name of the “Repeater” meta field;
  • Listing item name — give a name to a Listing;
  • Listing view — select either to operate with the Listing in Elementor or WordPress Blocks editor (Gutenberg).

Then, click the “Create Listing Item” button.

Elementor settings

Place the Dynamic Field widget on the editing page.

Select the “Repeater Field” Source and enter the name of the “Text” meta field in the Object field / Meta field / Repeater key / Component prop bar.

To display the link as a video, toggle on the Filter field output and select the “Embed URL” option as the Callback. After those actions, the video will be displayed appropriately.

dynamic field embed url callback for the video display

Also, the Style settings can be customized; for example, we alter the Field content width to “Full width”.

dynamic field style settings

After that, the Listing can be saved by pressing the “Publish” button.

WordPress block editor settings

Drag and drop the Dynamic Field block on the editing page.

Select the “Repeater Field” SOURCE and enter the name of the “Text” meta field in the OBJECT FIELD / META FIELD / REPEATER KEY / COMPONENT PROP bar.

To display the link we put on the backend as a video itself, toggle on the Filter field output and select the “Embed URL” option as the CALLBACK.

dynamic field embed url callback for the video display in wordpress

To style up the Dynamic Field block, you can install and activate the free JetStyleManager plugin. Open the style settings by pressing the “paintbrush” icon.

dynamic field block style settings

After that, the Listing can be saved by pressing the “Save” button.

Placing the Listing Grid Widget/Block on the Single Post Template

Warning

Listing Grid with the “Repeater” Listing template can be displayed only on the Single Post page.

We’ve adjusted the Listing template, and it’s time to display it with the Listing Grid widget. 

Edit your Single Post template (created either with JetThemeCore or Elementor Pro) in the preferred editor and drop the Listing Grid widget/block.

Type in the name of the Listing for “Repeater” you previously created and set up the number of columns, posts, and other parameters.

Finally, the Single Post template settings can be saved.

listing grid with video list from the repeater field

That’s it; now you know how to display video in the Listing Grid with the “Repeater” field by using the JetEngine plugin for your WordPress website.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

Get answers from 30K+ Crocoblock Community experts from all over the world.

Start a live chat

Ask question to support agent and share its details via chat messages.