Using python script in plone page

If I write some python scripts in zope how can I include it in the plone page.

For eg:
I want to create my own map with folium and written an python script with ZMI. How to add that to my plone page?

The correct way for including your own code in Plone is to write proper filesystem-based code as a browser view. Using ZMI-side scripting and templating is neither supported nor encouraged. ....or look into

...but stay away from the ZMI for scripting.


As said: yo want to make browser view.

About the maps: what are you trying to make ?

1 Like

just a map to add marker to the location that the user enters

Make it a browser view or check for existing map addons.
As said: no coding in the ZMI...never ever.

1 Like

thanks dude

Someone already made this (collective.geo), and it can also be done with path-leaflet

If you add plone.pattetrnslib / collective.geolocationbehavior / plone.formwidget.geolocation and a view

Probably not put the logic in, but it could be done something like this:

<div class="geolocation_wrapper">
         <div class="pat-leaflet map" data-geojson='{
           "type": "FeatureCollection",
           "features": [
               "type": "Feature",
               "id": 1,
               "properties": {
                 "popup": "<h4>${context/Title}</h4><p>Latitude: ${context/geolocation/latitude}<br/>Longitude: ${context/geolocation/longitude}</p>"
               "geometry": {
                   "type": "Point",
                   "coordinates": [
        ]}' data-pat-leaflet='{
           "fullscreencontrol": true,
           "locatecontrol": true,
           "zoomcontrol": true,
           "minimap": true,
           "geosearch": true,
           "geosearch_provider": "google",
           "addmarker": false

thank you