Skip Navigation

[Closed] Conditional block to display an image

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.

Our next available supporter will start replying to tickets in about 6.70 hours from now. Thank you for your understanding.

This topic contains 7 replies, has 2 voices.

Last updated by Christopher Amirian 1 year, 7 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2598797

jww

Hi,
I have a post which is generated by an RSS feed. Some feed items have featured images, some don't. If they do AND they have an image in the content, it shows up as a double image on the post. I don't want this.

Can I set a condition on the Toolset Conditional Block with the image in it which says "Display this image only if the post content does not have file type .jpg, .jpeg, .png, .gif in the post content field"?

I'm not a developer and don't have one.

Thanks in advance.
Laura

#2598799

jww
Screenshot 2023-04-24 at 11.40.34 AM.png

I tried inserting a conditional block to play with the logic but I don't know what I would do here...
See screenshot.
I want to the logic to be "If the post content contains and image, don't display the image in this Toolset Conditional Block" (assuming I can put an image IN the Toolset block??)

#2598809

jww

I understand how the conditional block works now after watching a tutorial.
I dragged the image block in question into the conditional block.
I need help with the conditional settings.

Is there a way to send a link which would not be publicly displayed for you to see the page in question? The site is in development.

The idea is...if there is an image in that field, don't show the image box, therefore preventing a double image from appearing. If it's there, it will be the same as the first image in the post. So am I setting the condition to a field to be empty?

#2598811

jww

Also, I'm new to Toolset and just learning how it works.
1. In the tutorial I watched, when he went to edit a condition, it was always set to the visual editor (which I like, being a non developer). But in my case, it's defaulting to the code editor not the Advanced Editor. Why is that? I don't see a setting in the main settings to tell it to default to the regular visual editor like it is in the tutorial?

#2598969

Christopher Amirian
Supporter

Languages: English (English )

Hi Laura,

You can provide the login information by setting the next reply as private. Please make sure you have a backup of the website before sharing the login.

At the top right section of the conditional block you can use the Advanced Editor toggle to turn the advanced mode on or off.

Regarding the conditions, you need to select the image that you use, for example if the featured image is used or a custom field is used. There is no other way to select the left portion of the equation.

The compare feature needs to be EMPTY one, that will remove the right side as you just check if a custom field or a featured image is empty or not.

Thanks.

#2600241

jww

I changed my email in my Toolset profile to one with no image on Gravatar. I'm still seeing my photo on my posts.

#2600249

jww

I see your suggestion about the steps but that doesn't get to where I need to get.
I want it to look at the post content and see if there are any images contained within it. If there is a png, jpg, jpeg, gif IN the content THEN don't display the featured image block.
Is that possible? I'm considering building dozens of sites with Toolset and that will be key to them all.

#2601211

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

No that is unfortunately is not possible with only Toolset as it needs internal code to detect such images and Toolset does not have such a tool.

Your best bet, in this case, is to clean up the content to have Featured Images in WordPress. Then you will have access to the Featured Image in the Toolset and you can use Conditionals there.

-------

Regarding the image, it seems to be a cache issue as I do not see any images int he profile. Please clear your browser cache and check back again.

Thanks.

The topic ‘[Closed] Conditional block to display an image’ is closed to new replies.