I am trying to: figure out how to edit the map address of an office
I visited this URL: lorezosan-realestate.discover-wp.com
I expected to see: an address property that I can edit in "Property Details - Office" or in the Office taxonomy.
Instead, I got: nothing.
What I am trying to achieve: I have created a CRED office add and edit form successfully but would also like to have the user input/amend the office address/location, so that it appears on the map.
Hi,
The Office post type in the Real Estate reference site is linked to a City, which is used to place the map marker for each Office on the map. However, this functionality isn't hooked into the CRED form so it's a bit confusing. If you want to associate an Office with a City, I can help you add that to your CRED form. However, it sounds like you want to give users the ability to specify an actual address. To accomplish this, you must add an Address custom field to your Office post type. I can help you with this too. Here are some details about how to accomplish that:
- Go to Toolset > Post Fields and edit the "Property Details - Office" field group.
- Click "Add new field" and choose an Address field. Name the field "office address" or something similar, insert the field, and save the Field Group.
- Go to Offices > All items, click to edit the Office called "Small Office", and see the new address field in the editor area. You will see a notification here that says "You need a Google Maps API key to use Toolset Maps address fields. Find more information in our documentation." In order to see a map, you must supply your own Google Maps API key as described here: https://toolset.com/documentation/user-guides/display-on-google-maps/
- Next you must add this field to your Office CRED form so that users can set the address field on the front-end forms. Go to Toolset > Post Forms and edit "Add Office" form. Place your cursor in the form contents where you would like the address field to appear, then click the "Add Post Fields" button. You will find your new office address field in the "Custom Fields" section. Click to add the field, then save your form.
- Finally you may wish to add the field to the Layout used to display Offices, the Single Property Layout.
Let me know if you are able to perform these steps, then we can proceed.
Hi Christian,
Thank you for the all detailed information. I was indeed getting crazy trying to figure out where the address was coming from. I had guessed it was from the city name, but I changed the city name and the map was still pointing to the same location.
Anyways, I have managed to create the API key, and amended both the Add and Edit post forms. However, I am still facing the following problems:
1) Although maps work fine in add/edit forms, I see some "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT" error in the console (see attachments, including Google API).
2) I have followed the instructions, but I am not able to see the newly added marker as per my custom address field "office-address" in the "Single - Property" view. Map shows empty in the middle of the ocean. However, if I restore the name of the field to the original "wpcf-property-location", map shows the original city (see attachments).
If needed, I can grant you access to my site to take a look.
Thank you so much
Hi, nice work so far.
I see some "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT" error
Usually an ERR_BLOCKED_BY_CLIENT error indicates you have a browser extension that is blocking some required files. Please try to disable your ad blockers and any other extensions, then review again. If the issue is not resolved, open a separate ticket so we can investigate this issue.
However, if I restore the name of the field to the original "wpcf-property-location", map shows the original city
This would seem to indicate that the issue is related to your office property field. Please check the slug of this field and ensure there are no typo errors, like "-" instead of "_". Then edit the post created by this CRED form. Is the office address saved correctly there? If not, that would indicate the CRED form did not send the address information along correctly. If there were JavaScript errors related to your Ad Blocker, this could be part of the problem, but I would need to investigate further. I will enable private reply fields here, so you can share login credentials if none of these steps help resolve the issue.
All your View code looks good now, but there is a problem with your site's Google Maps API key. Is it restricted to a specific URL? When I replace your key with my own unrestricted key, maps and markers work correctly. I'm attaching a screenshot of this.
I recommend generating a new API key, or modifying this key to work on your site's domain. I'm attaching a screenshot of the Google API Console. This is where you can modify existing keys. You may need to remove certain restrictions here to make your key work on this site. If you need help generating or managing your Google API keys, you may need to contact their support team.
Hi Chris,
You were so right also this time. The problem was indeed with my API Key. I had it restricted to the site URL, but I had forgotten to add a * after the url (i.e. *mysite.com/*).
Thank you so so much and so sorry for wasting your time for a problem not related to Toolset 🙁