3
votes
Accepted
How to get country list array with their corresponding country codes
You get the infinite loop, because the country name is a translatable markup and print_r() can't handle this object. If you cast the country name to a string, then it is printable in php:
$countries ...
3
votes
Accepted
How can I pass the filter parameters of one view to a different view on the same page?
Yes, it's possible to have 2 different views on the same page sharing the same exposed filter query parameters.
The trouble you're having is, by default, a block display doesn't show any exposed ...
2
votes
Set up Node content 'localization' / site wide region filter - similar to languages idea
There are two 'out of the box' solutions. The one is to use taxonomies to classify your content in different zones (one for the default zone), and views to decide when to display what.
All you ...
2
votes
How to get country list array with their corresponding country codes
$countries = \Drupal\Core\Locale\CountryManager::getStandardList();
foreach ($countries as $key => $value) {
$countries[$key] = $value->__toString();
}
$countries will return the array.
2
votes
Dynamically change widget type in node edit form
The use case you describe is specific in nature, but the question you actually asked in the title is more general purpose. I’m answering the question in the title.
To the best of my knowledge, there ...
2
votes
Accepted
How to send a custom Solr Distance Query with SearchApi
Debugging around I found the solution:
$index = Index::load('default_solr_index');
/* @var \Drupal\search_api\Query\Query $query */
$query = $index->query();
$query->keys($form_state->...
2
votes
How to show the distance relative to the user's location?
You need to install the Geolocation Field module and the example submodule that comes with it.
In the examples you will find a view that made exactly what you need, and you only will need to clone ...
2
votes
Accepted
Geolocation Field - Map Marker in Views
You need to create a display in your content type where you will put the field that you want to show in the tooltip.
Home » Administration » Structure » Content types » YOUR CONTENT TYPE » Manage ...
2
votes
Programmatically set latitude and longitude exposed input
I finally figured out how its supposed to be formatted. Kinting after the view execute rather than before exposed the field names.
$exposed = [
'center' => [
'coordinates' => [
'lat' ...
1
vote
Accepted
Is it safe to remove all untranslated strings?
Instead of a one-time deletion, I would periodically export your important strings to code. This is easy to script and means you will always have a backup if deletion goes wrong or a translator makes ...
1
vote
The geographic data (latitude, longitude) isn't saved in content
Geofield module doesn't work without the GeoPHP library. You need to download both the module and the library and place them in the correct locations in order for the module to work.
When using ...
1
vote
Accepted
How can I get lat/lon from an address?
Using google geocoding with geocoder module, you may use another geocoding provider, i think this requires a google map token now given google's new rules :
// @return Geometry Returns a geoPHP ...
1
vote
Smart IP doesn't show countries
To address your edit about the Views filter requirement, there's a submodule included with the main module, called "Smart IP Views Bridge". It has the functionality you're looking for. An ...
1
vote
Accepted
How to filter users based on address location?
I believe this is what you are looking for https://www.drupal.org/node/1944648
1
vote
How to filter users based on address location?
You can use geolocation_proximity
1
vote
Lat/Long not getting imported into Geofield via feeds importer
There is a bug in the Geofield module. When lat/long are set via Feeds, the Geofield module assumes the field to be empty because some other properties of the field are not set.
There is a patch ...
1
vote
Accepted
Taking node map from /map/node and using it on home page
Just create an appropriate view, give that view some path that you like, and set that path as your homepage. To actually create such view with the kind of data your question is about, have a look at ...
1
vote
How to make address1 field and zip code non required with Address Field module
I would use form_alter to hook into the form, identify the form element and unset or make required FALSE
eg:
mymodule_form_alter(&$form, &$form_state, $form_id){
if($form_id == 'xyz'){
...
1
vote
How to reduce options for units of measurement to just miles and km for proximity search
This isn't really in the form, via hook_form_alter(). It's an element of a form component, so you really need to implement hook_element_info_alter(), and add a "process" callback to the stack.
In ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
location × 3197 × 121
views × 78
google-maps × 75
entities × 44
javascript × 34
nodes × 17
search × 17
users × 16
8 × 13
theming × 10
taxonomy-terms × 10
database × 10
6 × 9
i18n-l10n × 9
feeds × 9
commerce × 8
migrations × 5
hooks × 4
rules × 4
importing-exporting × 4
forms × 3
ajax × 3
redirection × 3
tokens × 3