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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I am trying to use the following shortcode to get the distance from a location that is stored on the parent (this is the primary, or location I wish to measure from).
I am then within a view loop on the child post looking at the child location value post-meta custom field.
Like this below - I have also tried it with a short-code, but this didnt work.
In your case, you can create a content template, for example "parent-eoi-info", in the content display the shortcode without item attribute:
[toolset-maps-distance-value location="current-client-address' postmeta='wpcf-site-address']
In view's loop, display above content template shortcode with item attribute, for example:
[wpv-post-body view_template="parent-eoi-info" item="@eoi-map.parent"]
<br>
with item:@eoi-map.parent -
<br>
[wpv-post-body view_template="parent-eoi-info" item="@eoi-map.parent"]
<br>
with item:@eoi-site-connect.parent -
<br>
[wpv-post-body view_template="parent-eoi-info" item="@eoi-site-connect.parent"]
<br>
without item -
<br>
[wpv-post-body view_template="parent-eoi-info"]
RESULTS on front end:
with item:@eoi-map.parent -
with item:@eoi-site-connect.parent -
map: END.
Dev Site address: END.
Client AddressOatlands Crescent, Oatlands NSW, Australia END.
without item -
map: END.
Dev Site address: 10 Eastern Creek Drive, Eastern Creek NSW, Australia END.
Client Address END.
New threads created by Jamal and linked to this one are listed below:
Languages: English (English )Chinese (Simplified) (简体中文 )
Timezone: Asia/Hong_Kong (GMT+08:00)
Please provide the duplicator package, you can put the package files in your own google drive disk, share the link only, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks https://toolset.com/faq/provide-supporters-copy-site/
The 'Map' page is going to contain the view that displays the data from parent EOI (address of the head office), the 'sites' are proposed locations the business may like to move too.
Therefore I would like to compare the businesses current location (EOI Current Client Address, on the EOI CPT) to all of the 'Sites' ( Site Address'es) on the 'Map' page.
There may be a better way of organising this but this is what I came up with 🙂
The 'Map' page will be shared with each client so they can decide based on the distance from their current office to their new proposed offices.
Languages: English (English )Chinese (Simplified) (简体中文 )
Timezone: Asia/Hong_Kong (GMT+08:00)
Thanks for the confirmation, please try these:
1) Create a post view "child-site-posts":
- Query "Sites" posts
- Filter by post relationship or repeatable fields group owner:
Select posts in a EOIs Sites relationship that are a related to the current post in the loop.
- In views loop, display the distance shortcode like this:
This worked a treat, I could also use: [toolset-maps-distance-value location='[types field="current-client-address" item="@eoi-site-connect.parent"][/types]' postmeta='wpcf-site-address']
on the initial view between the Markers to get the distance on the popup perfectly.