Comments (7)
experiencing the same issue. i tried adding it into a template or creating a new contenttype but with no luck. any solution?
thanks!
from bolt.
@edanao I'm pretty sure your problem is that you haven't set the google_api_key
in your config.yml (if the field is showing, but not working.). If the field is just not showing at all perhaps you could open a new issue, as this one was about it not showing on the frontend and was solved four years ago.
from bolt.
thanks for the quick reply @SahAssar !
Yes the field is showing properly when creating the page after I added the google api key but it is not showing in the output page.
from bolt.
@edanao Ah, in that case you probably want to look at https://docs.bolt.cm/3.0/templates/record-and-records#geolocation which describes how to use the field. :)
from bolt.
thank you so much @SahAssar !
I just started Bolt 2 days ago.
Now my problem is that the page does not return any geolocation.
I created a new page and used a custom template to add the geolocation field. In the template twig, i added tags for the map display.
<h1>{{ record.title }}</h1> <div> <img src="http://maps.googleapis.com/maps/api/staticmap?center={{ page.geolocation.latitude }},{{ page.geolocation.longitude }}&zoom=14&size=617x300&sensor=false&markers={{ page.geolocation.latitude }},{{ page.geolocation.longitude }}&key=AIzaSyCFho-vawlTpR2CfswI1GKx3JoPX6Tmulk"> </div> {{ fields() }}
It doesn't return any geolocation from the page object. :(
Again, thank you for your help!
from bolt.
If the geolocation field is in templatefields then you need to use page.templatefields.geolocation
to access it, so the full snippet would be <h1>{{ record.title }}</h1> <div> <img src="http://maps.googleapis.com/maps/api/staticmap?center={{ page.templatefields.geolocation.latitude }},{{ page.templatefields.geolocation.longitude }}&zoom=14&size=617x300&sensor=false&markers={{ page.templatefields.geolocation.latitude }},{{ page.templatefields.geolocation.longitude }}&key=AIzaSyCFho-vawlTpR2CfswI1GKx3JoPX6Tmulk"> </div> {{ fields() }}
Lemme know if it doesn't work out for you!
from bolt.
thank you @SahAssar ! it works! 👍 💯
from bolt.
Related Issues (20)
- error when accessing boltcms url HOT 8
- Export 0000-00-00 00:00:00 dates as Unix time
- SetContent is not case-insensitive in all databases
- template field lists underscore files in subfolders HOT 2
- Bolt CMS 3.7.4 incompatibility with PHP 7.4 - Trying to access array offset on value of type bool
- Trying to get in touch regarding a security issue
- BOLT is crashing when optimizing python HOT 2
- Uploaded PDF Files not opening in browser HOT 1
- Database export Nut command does not export relations between records HOT 1
- Keep the current locale visible in backend viewport at all times HOT 1
- Problems Run bolt.so on M1 Mac HOT 1
- Cannot Install Bolot 5 HOT 1
- Language support for 403,503,404 HOT 3
- Old AVX test fails due to GPF/sigsegv HOT 1
- Plans for Bolt 6 / Symfony 6 / Stimulus / API Platform 3 HOT 3
- DELETE method not working for Contents API
- app/nut database:export outputs unexpected results for multi-contenttype select fields HOT 1
- Dependency Resolution Performs Extremely Slowly HOT 1
- bolt fails to deploy on hosts with debian bookworm HOT 2
- SSL certificate is expired on main website
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 bolt.