How to Add Location Fields to Post Types Like Blog and Community Articles

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000095504-how-to-add-location-fields-to-post-types-like-blog-and-community-articles

In this article, we will be going over the steps on how to add location and map fields to post types like blog and community articles.


Editing the Form 

The first step is to navigate to Toolbox >> Form Manager and click Customize or Edit on the preferred feature form. In the example below, we used the Blog Article:




Next, add 4 new form fields in the preferred place:




These 4 new fields should look like the following:


1) Location Map widget

 

Type of Field: Custom HTML

Field Label: [widget=Bootstrap Theme  - Form - Member Google Location]
Database Variable: not important



2) Latitude Field

 

Type of Field: Hidden Field

Field Label: blank
Database Variable: lat



3) Longitude Field

 

Type of Field: Hidden Field

Field Label: blank
Database Variable: lon



4) Address Field

 

Type of Field: Textarea - Paragraph

Field Label: %%%location_label%%%
Database Variable: post_location

Addtl. Field CSS Class: form-control




Save changes and the location fields will start appearing when publishing/editing the post in the member dashboard area:



Front End Display

Once the information is saved and the Bootstrap Theme - Module - Post Location Map widget is added to the sidebar, the map will display in the details page of the post:



Using the Members Location for Posts


If there aren't any location fields for the post type, there is an advanced setting that will use the members location 




Set to ON to save the lat and lon (geocode) of a member with their post if the post's form does not have lat and lon fields. Set to OFF to only save a lat and lon for a post if the fields exist in the post's form.