Skip Navigation

[Resolved] Using alternate image on main page and archives

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 3 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1963383

I've got one image loaded on each post under asset-image in an field group called asset-info.

First, on section pages We create a link to the post page and in that is the image using a dynamic source:

<img src="[tb-dynamic provider='__current_post' post='current' source='toolset_custom_field|asset-info' field='asset-image' force-string='first' ]" alt="%%tb-image-alt-text%%" class="%%tb-image-wp-image-class%%"/>

I've also added a new field where we can load multiple extra images called in-game-image. what I'm looking for is the best way have the dynamic source pull the image from in-game-image and if there is none loaded then fall back to asset-image (either dynamic tag or if statement.

We use basically the same on the actual post page and want it to change also. So just want to find the best way to do this

#1964067

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Based on the description you shared - as I understand, you want to conditionally display the content.

So, you have a repeating image field and if there is no image available with that field, you want to display the single image field "asset-image" - correct?

if yes, you can use the conditional block to display the conditional content. Please check the following Doc that might help you:
- https://toolset.com/course-lesson/using-toolset-conditional-block/