Skip Navigation

[Closed] Value Check of a field of a CPT in relationship

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 1 year ago.

Assisted by: Waqar.

Author
Posts
#2580005

Hi !

I have created a content template that display the photographer's names.

These photographers names are a CPT which is in relationship wit a project.

I need to display these photographers names on the project page. So I have inserted the Content template "photographers names" inside the project page blocs.

BUT in this Content Template I need to check if the "photo-website" field of the Photographers CPT is empty or not to display the name with/without a link to their website.

How can I make this condition ? How ca I check in my content template if this field is empty or not ?

Thanks for your help.

#2581223

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

Instead of a content template, you can add a view to show the related 'photographers' posts, inside the template that shows the single 'project' page.
( ref: https://toolset.com/lesson-placement/lesson-placements-1729031-1730449/#displaying-many-related-items )

Inside the loop of this view for the 'photographers' posts, you'll be able to use the 'conditional' block to only show some content, based on the current photographer post's custom field value.
( ref: https://toolset.com/lesson-placement/lesson-placements-1621067-1292451/ )

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2581263

Hi Waqar,

Unfortunately I can't find then way to check my related post field value...
Can you please help ?

I have CPT "Projects" in relationship with another CPT "Photographers".

CPT Photographers have 3 fields : 1st name, name and website url.

I need to check the website URL to know if I display the photographers name as a <p> or a <a href="website">.

How can I check the website field value ? I need to check if it's empty or not to display. one way or another...

#2582885

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

To suggest the best way to achieve this, I'll need to see how the involved elements are set up in the admin area.

Can you please share the temporary admin login details, along with the example 'project' post page, where you'd like to show the related 'photographers'?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

The topic ‘[Closed] Value Check of a field of a CPT in relationship’ is closed to new replies.