• Short version: is there a clever way to pass the source url of a geojson file to the Leaflet plugin as a variable or nested shortcode rather than a hard-encoded URL? For instance rather than

     [leaflet-geojson src="/path/to/file"]

    is there a way to do something like

    [leaflet-geojson src=[my-geojson-shortcode]]

    Longer version:

    I’ve got a custom post type that I created with ACF called “Routes”. Each route has and ACF “file” type field where I can upload the geojson associated with a route. I’ve selected the option to have ACF return the full file path (e.g. https://mysite.com/path.to.file.geojson) when the field is referenced.

    I’m trying to create a template with Divi so that each route page will display a map with the geojson data. Therefore, I’m looking for a way to call the geojson data with some sort of placeholder. Are there any work-arounds within the leaflet-geojson shortcode that would allow me to do something like this?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Pass geojson source as a variable in shortcode?’ is closed to new replies.