Location custom field by AddonsLab

Location custom field by AddonsLab [Paid] 2.0.1

No permission to buy ($39.99)
@Robert9 we are preparing a next release with Google places autocomplete for the address field (when entering the value, not in the filters) and will review and answer your questions based on the latest version.

Thank you!
 
Thank you. But please tell me: Can i do just this without any Google stuff:

1. Add only Austria, add all areas, add all cities (i want)
=> Yes, possible

2. Select the values for my custom_field with Austria, area, city
=> Yes, possible

3. But now i wish to have a filter_form, where i choose
a) Austria => i get the areas
b) Area1 => i get the cities
c) City

Start filtering ...
and getting all resources with just this city in this area in this country. Because this is what i wait for, when i choose:
Country/State/City selection


And which reason should you have to say "Range based search needs google maps apis"
This means that "Country/State/City selection" should not need any google stuff, right?

But without any google stuff, there should be no fields for distance!


If this is not possible i can solve my task only like:

one forum for area1
one forum for area2
...
one forum for areax

add all cities to the forums, where they belong as normal radio_field


But then i dont need the location addon.

Sorry, when i get on your nerves, but i just dont understand why the

Country/State/City selection

doesn't work like it should from my understanding.

Now a client waits for my solution and i have to say: sorry, doesn't work. :(
 
Last edited:
A range based search is really nice, but it always needs Google.
If you could offer this, it would be enough for some needs i guess:

choose Austria
=> get all threads with Austria

Choose Austria and area1
=> get all in Austria and Area1

Choose Austria and area1 and city
=> get all in this city

And better:

Choose Austria, area1, city1 and city2
=> get all in city1 and city2
 
<xf:if is="$config.getSearchFormatOption()==='range_search'">

It seems to me that this is ALWAYS TRUE, because i never see anything else than the form for range based search.

--------------------------

Also i would like to know, why the location addon needs any data in

xf_rm_resource_field.location_option

you save something like that for every field

Code:
{"filter_format":"range_search","country_field":{"display_mode":"select","default":"","highlighted":"","custom_list":""},"state_field":{"mode":"text"},"city_field":{"mode":"text"},"zip_code_field":{"mode":"text","regex":""},"street_address_field":{"mode":"text","regex":""},"full_address_format":"{streetAddress}, {zipCode} {city} {state}, {country}"}
 
I have a big wish, please.
Just try to change your location field in your forum to "selected" instead of "range search".
I really want to see, what happens then in your forum.
 
Is there anybody who uses "search by selection" instead of "range search" and has a public forum where i can see the form, please?
 
I have a big wish, please.
Just try to change your location field in your forum to "selected" instead of "range search".
I really want to see, what happens then in your forum.
Please check it in our demo:


You can modify custom field information yourself in the admin panel, using "admin1"/ "adminpass" account.


1619271955982.webp

xf_rm_resource_field.location_option

you save something like that for every field
It is saved for every "location" type field, not every field, and the information holds field configuration. Is there any reason why you are concerned with the information stored there?

<xf:if is="$config.getSearchFormatOption()==='range_search'">
It seems to me that this is ALWAYS TRUE, because i never see anything else than the form for range based search.

It is not only range search, it can be also selection search, as you can see in the screenshot.

We are preparing the next release of the add-on with further options and will update here soon.

Thank you!
 
Thank you very much.
I tried to install and use the location-addon in different forums with threads or resources. It doenst matter, what i do - i never see this form!

firefox_kVjTLo2rQm.png

I always see this form

firefox_RGDA0oy0vX.png

while my options are like this:

firefox_PRyIwvH3XZ.png


And here you see my table (i have moved the coumns to show it better)

firefox_G3GMcubARI.png

This is what i am waiting for to see:

firefox_kVjTLo2rQm.png

but i never have seen it.



Probably this form should be done in:


firefox_X95ApAL54b.png


Yesterday i have changed the template.xml. I have deleted both "public" templates after i have tried this before:

<xf:if is="$config.getSearchFormatOption()==='should_not_be_true_range_search'">
instead of
<xf:if is="$config.getSearchFormatOption()==='range_search'">

in allf_custom_fields_macros.

So i found out that this template is just not used!
I can empty it, delete it or install the addon just without these both templates!
(If i delete the templates i cant insert data, but the form is there)


firefox_ehMcDGwN9O.png


I always see this form!


firefox_RGDA0oy0vX.png

So this part of the form is done somewhere else, but not in the template mentioned above.
I have tried older versions and the newest version. I just never see what i am waiting for:

firefox_kVjTLo2rQm.png
 
Last edited:
Install XF
Install RM
Install AL Core
Install Al RM Filter
Install Location

Add custom_resource_field as location_field => use "selected search" not "range search"

firefox_PRyIwvH3XZ.png



Check the checkboxes in RM Cats to use this field for cats.

firefox_oErs52YsPY.png



View RM Overview

firefox_l5tJG8ExEQ.png



Result: Form for range search

firefox_RGDA0oy0vX.png
 
Last edited:
Finally there must be something else what i have to do?
Click an option, use another row of doing (first this, than that), use another version, dont use other addons ...
 
Finally ... after hours and hours ... i have solved it.
It seems that the rm_filter is not updated like the thread_filter.

In thread_filter you have in altf_forum_view_active_filters

<xf:macro template="allf_custom_fields_macros" name="filter_value_location" arg-info="{$info}"/>


but in rm_filter you still have

Code:
<xf:macro name="filter_value_location" arg-info="!">
    <xf:if is="{$info.templateParams.unit}==='km'">
        <xf:set var="$unit" value="{{ phrase('alrf_km') }}"></xf:set>
        <xf:elseif is="$info.templateParams.unit==='mile'"/>
        <xf:set var="$unit" value="{{ phrase('alrf_mile') }}"></xf:set>
        <xf:else/>
        <xf:set var="$unit" value="$info.templateParams.unit"></xf:set>
    </xf:if>
    <xf:set var="$distance">{$info.templateParams.range|number}</xf:set>
    <xf:if is="$info.templateParams.config.isCountrySelectionEnabled()">
        <xf:set var="$address">{$info.templateParams.address}, {$info.templateParams.config.getValidCountryName($info.templateParams.country_code)}</xf:set>
        <xf:else />
        <xf:set var="$address">{$info.templateParams.address}</xf:set>
    </xf:if>

    {{ phrase('alrf_within_distance_unit', {'distance': $distance, 'unit': $unit, 'address': $address}) }}
</xf:macro>


This is the reason why i have always the range_form;
this is the reason why i could change or delete allf_custom_fields_macros
without any change.



So you may please update the RM_Filters;
you may also care for some of the other features you have in thread_filters but not in rm_filters like

Code:
                <h3 class="block-minorHeader block-filterBar">
                    <xf:if is="{$xf.options.altf_auto_collapse}">
                        <span class="collapseTrigger collapseTrigger--block" data-xf-click="toggle" data-target="< :up:next">
                            {{ phrase('filters') }}
                        </span>
                        <xf:else/>
                        <span>
                            {{ phrase('filters') }}
                        </span>
                    </xf:if>
                </h3>


or for altf_thread_filter_form_macros

It would be really nice if both addons for threads and resources could/would be on the same level.


And some of the templates in the template.xmls maybe could be moved to have them just in the same order like in the other addon, please.
It is just easier to compare, because so many things are just the same or almost the same.


Sorry for getting on your nerves so many times ... finally i have found it. :)
 
Last edited:
Finally ...

firefox_3v0qNpaNLX.webp

and the next question.

We need an update for field 1 to get data for field2?

If you live in Austria you maybe have Austria, Germany and Switerland, bcause of the same language, but with focus on Austria.
Then it would be nice to have a default and load at least the first field with default Austria and the second with the list automatically.
Else maybe 95% of the people hate to come daily and do daily the same (unnecessary) click for Austria.
 
Hello!

Thank you for sharing your troubleshooting results, we are going to check and fix Resource fix asap.

If you live in Austria you maybe have Austria, Germany and Switerland, bcause of the same language, but with focus on Austria.
Then it would be nice to have a default and load at least the first field with default Austria and the second with the list automatically.
Else maybe 95% of the people hate to come daily and do daily the same (unnecessary) click for Austria.

Just check the location custom field options in the Edit field page, there is an option for Highlighted countries. These countries are shown on top of the list and only then the remaining. I guess this will solve the case you have.

Thank you!
 
The highlighted ones are on top, but not selected.
If you have 95% people from austria and 5% from germany and switzerland it makes sense to have a selected country austria and loaded list2 for area.


Another solution would be to use
cats for the countries to separate resources.

But then we have no way to choose the country by cat.
This would be also a nice solution if the locationfield could have a setup by cats to say:
selected country = x, not visible
selected area = y or not selected

Just as ideas.
 
From testing and feedback from users it makes absolutely sense to have an option for the area to force users to choose a city for the input, but allow "all" for the the filter. You may have a hint where to start this?
Probably there is a template for that and i need something like:

if filter/form
option value="">All</option
end
 
Also you may want to add required="required" to all required fields.
It looks not nice if we have that wonderful error-message directly in/at a field for some fields and then the oldscool "oops. something is wrong: Please ..." where a user needs to search the right field.
 
Another problem:
You have country, area, city choosen and saved.

Now choose another area.
Then reload the page.

Funny!

Now you have area_choosen,
but cities from area_saved.
 
AddonsLab updated Location custom field by AddonsLab with a new update entry:

New field format: Text field powered by Google Autocomplete

The release implements a new format for the custom field - a text field powered by Google Places auto-completion. Administrators can choose if they want to use the older format or the new one for each custom field.

Google Places API key is required for the new option. Please check the product settings after the upgrade.

The new version is available for all licensed customers at https://customers.addonslab.com/marketplace.php/my-services/

Thank you!

Read the rest of this update entry...
 
Error during upgrade:
"Exception: xf_allf_google_place_cache: MySQL query error [1071]: Specified key was too long; max key length is 767 bytes"
 
Back
Top Bottom