• Resolved spypots

    (@spypots)


    This is my complete problem that I haven’t been able to solve the last week.
    First of all, I am no programmer and trying to bould a site with Pods and Elementor.
    I now know that Elementor cannot fully cover me, so some coding will be made, but still I cannot find answers. So:
    I have the Pods:
    “Event” (Events) with fields: “event_name” (text), “event_date” (date) and “featured_artist” (bi-directional to “artist.participated_events” with multiple selection).
    “Artist” (Artists) with fields: “artist_name” (text), “artist_bio” (text editor), “artist_photo”(image) and “participated_events” (bi-directional to “event.featured_artist” with multiple selection).
    I have used Elementors template/ theme builder to create the an “event” post page.
    What I am trying to do is present in an events post, a card (template) of the featured_artist’s.

    I created a simple Pods template to present an featured artist data:
    {@featured_artist}
    {@featured_artist.artist_name}
    {@featured_artist.artist_bio}
    {@featured_artist.artist_photo._img.100x100}

    and tried to use it in a Pods – List Items” widget, but 1stly, it is not this presented in docs (https://docs.pods.io/displaying-pods/pods-blocks/) cause I see other options.
    I also tried to create a elementor’s loop item for the artist (NOTE: in the loop template fields are referal to “artist” as “artist.artist_bio” etch, using elementoers dynamic fields [Image: Pods Image Field (key: artist_photo), (Heading: Pods Field (key: artist name)].
    All the above are put into an event_post’s contaner.
    Solution 1: Pods list item, does not get as referal the current post, so it iterates one-by-one all artists that are listed as”featured_artist” of all the “events” -not the current. Moreover, In the end there is a “singularity” where for example in artist’s name we see all featured_artists names, then all photos. These are all the one-by-one artistis already displayed.
    Loop grid item: No matter what I select in the Loop items Query settings, it will either display all artists or none (Source: Related or Events, Query ID from post fields (dynamic) or custom made.

    So, what am I missing?
    Are there any things that I need to enable that are not default?
    How to iterate in an event’s featured_artists one by one, within a created template and display only the current pod’s featured_artists?

Viewing 1 replies (of 1 total)
  • Thread Starter spypots

    (@spypots)

    OK, Completely another solution.
    Instead of trying to feed the Loop Grid item with specific posts, or use the template in a “custom-made loop grid”, I decided to “diet” the main loop grid.
    So, I used a simple loop grid to source it with all the “artists” and created a query that filters out the artists whose “participated_events” match the current event.

    The query (in theme function / functions.php):

    <code data-l-s=”57872″>add_action( ‘elementor/query/filter_artists_by_event’, function( $query )
    <code data-l-s=”57872″>{
    $current_event_id = get_the_ID();
    $query->set( ‘meta_query’, array(array(‘key’ => ‘participated_events’,’value’ => $current_event_id,’compare’ => ‘LIKE’)));
    }
    );

Viewing 1 replies (of 1 total)
  • The topic ‘Pods with Elementor: Fetching bi-dirctional pods’ fields in template’ is closed to new replies.