netcarver Posted February 8, 2019 Author Share Posted February 8, 2019 Yeah, I can understand that, but I was going for a pretty opinionated input look - in part to try and provide a slick (fast) keyboard entry method for users at the charity - that really mimics an address label. Please feel free to share your "vanilla" CSS and whatever your findings are regarding getting it working with map marker modules - I know there will be some others in here who are interested in such an integration. 1 Link to comment Share on other sites More sharing options...
netcarver Posted March 17, 2019 Author Share Posted March 17, 2019 Just merged the localisation branch into master and pushed up the latest version of this module. We are now at version 1.1.1. 2 Link to comment Share on other sites More sharing options...
MarkE Posted June 19, 2020 Share Posted June 19, 2020 This is a really useful module. I have only had one issue so far - the default country setting in the field config page does not seem to work in the API. I have to set (e.g.) $this->address->origin_iso = 'GB'; for it to be effective. Link to comment Share on other sites More sharing options...
MarkE Posted June 22, 2020 Share Posted June 22, 2020 A bug? (version 1.1.2) On selecting a subfield in a lister and typing in the value to match, I get the error "Call to a member function isEmpty() on string" for line 55 of FieldtypeStreetAddress.module Link to comment Share on other sites More sharing options...
Confluent Design Posted February 7, 2021 Share Posted February 7, 2021 Not sure if this is appropriate place to ask this, but is there a simple way to alter/configure the appearance of the FieldtypeStreetAddress inputs in the PW Admin? Link to comment Share on other sites More sharing options...
netcarver Posted February 14, 2021 Author Share Posted February 14, 2021 @Confluent Design Nothing amazing I'm afraid, you'll have to edit the included CSS file (InputfieldStreetAddress.css) - or override the selectors it uses with your own in another CSS file that gets loaded later. 1 Link to comment Share on other sites More sharing options...
clemens Posted March 9, 2023 Share Posted March 9, 2023 First of all: thanks for this field, it's great. How can I override the ISO used for rendering the field? It always comes out as the wrong format (City, Zip) despite only "German" (Zip City) being present in the field options. I've resorted to just overriding the iso codes at the start of "formatLines()", but that's dirty as hell. Is there a way to set the formatting language when/before getting the field value from the page? Link to comment Share on other sites More sharing options...
netcarver Posted March 9, 2023 Author Share Posted March 9, 2023 @clemens Thank you for the +ve feedback. I'm not sure I understand the issue you are having based on your description, but you can easily override the output formats, which are pulled from Google's LibAddressInput project, by simply editing the example.formats_overrides.php file in the FieldtypeStreetAddress/ directory. You'll need to look at the "Reading the JSON" section of the LibAddressInput project documentation to see what each of the fields is. In case it's not obvious, "%n" is a newline. This might allow you to do what you are after but, if not, please post again. Here's what one of my local DE-based addresses looks like - with no changes to the defaults from Google. This seems to have things in ZIP CITY order... Link to comment Share on other sites More sharing options...
clemens Posted March 10, 2023 Share Posted March 10, 2023 @netcarver Thanks for replying so quickly. The address is displayed correctly in the preview when editing the page. The issue comes when outputting the field/getting the field value via $page->get("address_field"). I alway get "city, zip" in the resulting html. How is the localization determined here? Is it the language ProcessWire is set to? Can I force the field to output German localization here as well? Link to comment Share on other sites More sharing options...
netcarver Posted March 10, 2023 Author Share Posted March 10, 2023 If you put this in your template file, just before you try outputting the address, what do you get? (Remove the PHP tags if you need to, and/or add nl2br() around the output to make it prettier)... <?php $country = 'DE'; $format = var_export(StreetAddress::getFormat($country), true); echo "Format for $country is [$format]"; ?> Here's what I get locally (run from the command line though) The other thing to check is that the address you are formatting is actually tagged up with Germany as the destination country? Link to comment Share on other sites More sharing options...
clemens Posted March 14, 2023 Share Posted March 14, 2023 This is the resulting format. The address itself should be German since only Deutschland is allowable. I've also set all addresses as domestic and the country of origin as DE, too. Still, this is the resulting HTML: It only displays properly when I do this to your module: Link to comment Share on other sites More sharing options...
netcarver Posted March 15, 2023 Author Share Posted March 15, 2023 Looks like the default country ISO was not being used when the country inputfield only had a single option. I've pushed version 1.1.3 with a workaround in the output that should allow you to remove your changes. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now