Comments (3)
Thanks for the feature request. Have just released 1.5.0 that allows setting the content of the generated link.
In your case you can do:
{{ entry.phone.getLink({
text: entry.phone.format('national')
}) }}
See the README for more info https://github.com/rynpsc/craft-phone-number#links
from craft-phone-number.
@rynpsc How can get the getRegionCode() and the format using text?
Silly example here, but I bet you got the point:
{{ entry.phone.getLink({
text: entry.phone.getRegionCode().format('national')
}) }}
from craft-phone-number.
@estebancastro format
can only be applied to the base model e.g entry.phone.format('national')
. I'm not sure what your required output is but text
can be any valid twig expression.
{{ entry.phone.getLink({
text: entry.phone.getRegionCode() ~ entry.phone.format('national')
}) }}
from craft-phone-number.
Related Issues (9)
- JSON Decode error after migrating from plain text field HOT 2
- Field doesn't save when creating/publishing new entry HOT 2
- How to save phone number from front end form HOT 3
- getCountryCode() and getRegionCode() are mixed up
- Craft 4 500 error HOT 3
- Feed Me support HOT 3
- Incorrect href when using `tel` Twig filter HOT 2
- Search field value? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-phone-number.