Filter Looper output like Preview > CPT > Post

I’m trying to find a way to express my thought into words, so bare with me.

I have my looper setup correctly and I’m able to output a list of thumbnails ON each CPT, but I’d like to output collected lists of all thumbnails from each CPT on one page.

Is there a way to filter out the loop like you can for the Preview, on a specific column/row/section? I’ve looked through docs, videos and forum posts, but I can’t seem to find anyone else who’s looking to produce thumbnail loops like this.



I should add that I’ve tried several different types of queries, but the images keep reverting back to the thumbnails of the parent posts.

the airline logos are a 2-way relationship field between Airline & Destination CPTs.

Hi @splaquet,

What you are expecting here is not very clear. Can you please elaborate a bit more to help us understand? Also, we may need to investigate it through the WordPress admin dashboard. I would suggest you please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

I was having a hard time thinking how to put this into words, so I knew it’d be hard for me to explain this. I’ll try with more visuals.

What I’m trying to do is this…

I’m trying to put together a page of components, where the shortcodes would automatically update when the airlines and/or destinations changes.

So this section has the airlines on the back of the cards:
https://dev101.bradleyairport.com/journey-5/nonstop-destinations/#grid

I’m trying to make shortcodes of each destination, that I can insert into this code (like the highlighted example):

And have it produce a result like this (when you hover over a destination):
https://dev101.bradleyairport.com/journey-5/nonstop-destinations/#map

The loop will work as expected when inserted into a template, but I’m trying to produce a collection of the templates/components so our customers can easily reference the display and make any changes.

Hey @splaquet,

What you are trying to do may not be possible simply because you cannot pass a variable like the post ID from your [leaflet-maker] to the [cs_component] shortcode. What you can do is to manually add the ID or something that is in relation to your CS Component. For example;

[leaflet-maker iconurl="some-random-1.svg" iconsize="12,12" address="Atlanta, GA"]
[cs_component id="..." parameters='{ "destination_ID": "123" }']
[/leaflet-maker]

[leaflet-maker iconurl="some-random-1.svg" iconsize="12,12" address="Baltimore, MD"]
[cs_component id="..." parameters='{ "destination_ID": "456" }']
[/leaflet-maker]

[leaflet-maker iconurl="some-random-1.svg" iconsize="12,12" address="Chicago, IL"]
[cs_component id="..." parameters='{ "destination_ID": "789" }']
[/leaflet-maker]

You can then use the destination_ID in a Looper Provider Query String to be able to display the flights associated with the destination.

Hope this makes sense.

I haven’t really built out query strings before, so bare with me here…

so, would my query look like this?
post_type=destination&p=destination_ID&{{dc:acf:post_field field="direct_flight_airlines"}}