A simple way to display JetEngine relationship items with Bricks Loops

preview_player
Показать описание
This video shows how to create a simple relationship between Posts and Users. The users are "Post Contributors". I then show the Posts in a Loop, with a sub-loop showing the related "Post Contributors"

Because the related items are "Users" (WP_User), we need a function to get the fields we need. The video shows how to debug the data to have to work with and figure out what you need to display the required information.

08:50 Figuring out what data we have to work with
Рекомендации по теме
Комментарии
Автор

Thanks Alan! I was the one who asked lol. I was able to accomplish this as you said by creating the relationship but with a custom post type I made. Instead of going through debugging though and figuring out the function I just simply looked for the dynamic data related to the relationship I made. For instance, I am using the relationship "users" so I check the Bricks dynamic data list that had for users. It worked with data like {wp_user_display_name}, {wp_user_id}, {wp_user_login}, and so forth, all worked well.

Obviously, this won't work for every scenario and your method its still the best way to find out what you need to display that data. This is just people who lazy like me XD

scarlydesigns
Автор

Still works perfectly to display a related meta field! Is there any way to expand this to add a bricks filter using this meta field to filter the results?

MrLimenet
Автор

Honestly, one shouldn't have to know or even write function code for this. Makes me think what's the purpose of jetengine having relation 'functionality' without being able to accomplish something this simple! They could atleast allow one to use dynamic tags to pull this and alot of other data from a post object. One should not pay for Bricks.. then pay for jetengine, only to have to go through writing functions (even worse for a person who has no idea of functions / php / wp codex) just to get author's name, even on relationship loop.

Aside from the above.. you actually went a wayyyy more difficult route for this! There's no need for any functions.. you could have simply used the Post Content Element and a single dynamic tag for Author.. done in 2 mins.

BGdev
Автор

Awesome thank you very much for this useful content!
Is JetEngine leaner than acf, what do you think?

andrefranzke