Skip to main content
5 minutes reading time (1058 words)

How to use Joomla custom post types in location search engine

post-cover-maps-custom-field-2

My Maps Locations now offer custom post types so we can create fields and filter the locations submitted, making it a powerful extension that goes to the point and allow users to find exactly what they need!

Maps in Joomla sites (and in all sites in general) are useful and have many use cases, for example, if we want to display where is our business located or if we want other persons to share a location but one of the main issues is that we could end up with too many locations and it could be difficult to find one in specific that where My Maps Location help with all the filters that it offers.

With the My Maps Location custom fields, we will be able to generate a field with a specific type and make it appear on all locations settings, giving us all the control of how this filter will work.


How to create a custom field for a Joomla map

First of all, it is important to note that we need My Maps Locations installed in order to follow this tutorial.

Let's start with the first step which is create our custom field and for this, we need to go to Components > My Maps Location > Custom Fields.



On this page, we will see the New button at the top, let's click it to create our new Custom Field.



3 tabs will be opened that will allow us to fully customize and create our custom field, the first tab is General where we can add a title, type, description, as well as define if it is required and if we want it to be in a category, we can also set it to Public or restrict the access (if we want an advanced search, for example).

In this case, for the tutorial, we will create a filter for Area as if it is a site with a catalog of companies/services.

In this case, we will be using a radio field so we are able to create the options at the bottom of the page.



It is important to note that type has many options that we can select and we can also use ACF options there.



Now we have the second tab which is options, this tab offers us many advanced options so we can fully customize our new custom field, for example, we can add classes to our fields or if we want the radio to be a button or or a switcher, and many other options that are divided into 3 boxes.

Form Options



Display Options



Smart Search (to allow the field to be searchable)



Now we can go to the next tab that is Publishing where we can add a publish date to our filters as well as edit it.


And now we have the last tab which is Permissions, where we can allow or not other users to edit/remove the custom field that is being created.



We can fully customize our field and finish it by clicking on Save & Close.

And finished! Our custom field is ready to be set in our locations.


Adding Custom Fields to Joomla Maps locations

Now that our Custom Field is created, we need to set it up in our locations to allow the filter to know what to show when an option is selected or typed.

To do this, we need to go to the locations under My Maps Location > Location and edit our locations, of course, an option will be selected by default so we don't specifically need to edit all the locations, only the ones that we don't want to show with the default option.

In this case, we can see 5 different fields in this location.



Setting up our Custom Fields is as easy as choosing/typing an option there, our location will be ready to be filtered! As you can see, possibilities are unlimited with this easy-to-use feature.

Now we can proceed to add our map directly to our front site! In this example, we are adding it to a menu item.

First, we need to go to My Maps Location > Configuration > Advanced display configuration.



In this section, we need to find the Search Custom Field table, on this table, we can select and add the custom fields that are going to be added to the modules.



Clicking on the Add custom search button opens a section with the option to type a label, select the custom field, and the field type on the front pages.



Saving this will allow our search field to appear on all the search map modules in our site, no matter how it was added to the site, if it was to an article or as a menu item, the new search field will take effect!



We can also click on the location details and the Custom Field will be displayed as an extra information.



As we can see, this gives us full control of our locations allowing us to give as many features to the locations as we want now it will be easier for us to describe our locations and for our users to find specifically what they want.

It is also important to note that there are many integrations like HikaMarket that would allow us to make our e-commerce better!


Create searchable Joomla Maps

Awesome features come with awesome extensions and My Maps Location is not an exception in this case! With many map providers like Baidu, Google, or OpenStreetMap this powerful Map creator will allow your Joomla site to go to the next level! So what are you waiting for? Go here and get your extension!

0
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Friday, December 27, 2024

Captcha Image