Skip Navigation

[Resolved] Php-kod fot Toolset maps and marker

This support ticket is created 4 years, 11 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Torbjörn 4 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1486625

Tell us what you are trying to do?
Since you have decided not to further develop Layous, I have now started working with Oxygen instead. Layout and Views are very powerful, so I have to use Views very often to solve my tasks.
I have used maps on several of my sites but have now found that I can make maps custom fields in Types and then use it in Oxygen. It works well where there is an address in Google to use, but if I in admin select a location on the map it does not work in Oxygen. It seems that Oxygen can not view coordinates from Toolset. Have tried to insert shortcodes, but will have problems when 2 shortcodes are required to show a map with a place selected, one that shows the map and one that shows the marker. I can't get this to work in Oxygen. So now there remains a solution that I would like to test, but can not find on your support pages. I think I could type in php code instead of shortcodes, Oxygen has the ability to add in php code. I have found how to enter custom fields, but can not find how to enter a maps field as php code. Can you help me with that?

Is there any documentation that you are following?

Is there a similar example that we can see?
This has coordinates
hidden link
This has an adress I google
hidden link

What is the link to your site?

#1486945

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

You can actually use php code to get the data from the database. The code would look like this below.

echo(types_render_field( 'field-slug', array( 'arg1' => 'val1', 'arg2' => 'val2' ) ));

In your case the exact code would be.

echo(types_render_field( 'field-slug', array( 'format' => 'FIELD_LATITUDE, FIELD_LONGITUDE' ) ));

Now replace 'field-slug' with the correct slug for your address. This function should render your latitude and longitude coordinates.

The real reason why I suspect that the coordinates don't work for you with Oxygen is because the coordinates are not stored in the post_meta table. They are actually stored in a separate custom table.

However the text address is stored in the post meta table hence why Oxygen is able to gather the data. For more information you can have a look at the documentation that we have below on this.
https://toolset.com/documentation/customizing-sites-using-php/functions/#address

Please try this and let me know.
Thanks,
Shane

#1490217

My issue is resolved now. Thank you!
Hello and thanks!

I found out that I also could remove the curly brackets when editing the custom field for toolset maps.