maximus Posted 5 hours ago Posted 5 hours ago Hi everyone, Building a package forwarding platform means dealing with phone numbers from dozens of countries. US customers, European recipients, warehouse staff - each expects a different format. Storing a raw string and hoping for the best doesn't work. This fieldtype does it properly. GitHub: https://github.com/mxmsmnv/FieldtypeTel What it does Powered by intl-tel-input v28 - bundled locally, no CDN dependency. Country flag picker with search Stores four formats per number: e164 - +12025550123 - for tel: links and shipping APIs intl - +1 202-555-0123 - for international display national - (202) 555-0123 - for local display country - us - for filtering and selectors echo $page->phone; // (202) 555-0123 echo $page->phone->e164; // +12025550123 echo $page->phone->country; // us // tel: link echo "<a href='tel:{$page->phone->e164}'>{$page->phone}</a>"; // Selector — find all Australian numbers $pages->find("phone.country=au"); Restrict countries, set preferred countries, per-field defaults Auto-format as user types AdminThemeUikit themed - light and dark mode via --pw-* CSS variables Requirements: ProcessWire 3.0.200+, PHP 8.2+ MIT License.
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