Skip Navigation

[Resolved] How to connect custom fields

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.

This topic contains 6 replies, has 2 voices.

Last updated by fabriceS 11 months, 3 weeks ago.

Assisted by: Christopher Amirian.

Author
Posts
#2598521

How to connect custom fields

#2598533

Christopher Amirian
Supporter

Languages: English (English )

Hi there

Please consider that it is not possible to CONNECT a custom field to another custom field. Connection happens only between posts when they are in a relationship.

So if you can give more details about the custom field you use in the Building and what you want to show in the Apartment with the actual use-case I might be able to help.

Thank you.

#2598595

Hi Christopher.
Sorry for this appointment.

So I have my PT "Building". Inside "Building" I have different post fields : 1 to 5 Stars, parking facilities (Garage, private place, public parking), and Eco rating (from A to G on the scale).

The PT "Apartment" has post fields : number of bedrooms, number of bathrooms, square meters, etc...

A "Building" PT has a 1 to many relationship with the PT "Apartment".

I will never display the "Building" archives or pages, I will display only a list of apartments.

When I display an apartment I want to display some information of its related "Building".

In my case, when I click on an apartment link, I go to then apartment page on which I will display the pictures and its informations AND also then eco-rating and then stars of the building in which it is located.

to display then eco rating (from A to G) I want to display A B C D E F G and comparing the value have a particular CSS for the corresponding letter.

Maybe it's more clear like this ?

#2598701

Christopher Amirian
Supporter

Languages: English (English )

download.jpeg

Thank you, I have a better idea of the issue now.

So I wonder if you already can show the echo rating itself? If yes would you please share the link to an apartment page?

By checking the HTML code I might be able to come up with a Javascript code that achieves what you want. I guess you want something like the attached screenshot.

Thank you.

#2598723
Screenshot 2023-04-24 at 17.26.27.png

Hi Christopher

A kind of. It's more like the attached picture.
In the apartment page I can display the letter of the rating. What I can't do is a view or a content template with all the letters with a customised CSS if it's the corresponding letter of the Building.

As I started with that and the fact that I can't achieve it I still not have a link to give you with my work in progress...

#2598737

Christopher Amirian
Supporter

Languages: English (English )

Ok I suggest that youc reate the page and add only the result of the echo rate, for example B. then share the link and I will use that HTML code which is generated to create an A-G list and highlight B, or whatever option there is at that time.

It will be in Javascript code that you will be able to add to your View's JS Editor and it will work for all cases.

Thanks.

#2600019

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.