The simpler media website CMS
Hi,
I would like to exclude some js files and tried to add them to the 'Skip Elements' box.
Example:
zp-core/zp-extensions/openstreetmap/leaflet.js
But I cant get the leaflet.js excluded from beeing moved to the bottom of the page.
Not sure what exactly is the correct syntax for adding an js exclusion. Tried the full path like above or simply leaflet.js
But this does not work.
Any hints?
Ralf
Comments
To be a little more precise what is exactly the problem on my site:
I have created a page which shows all geotagged images on a map by using this code:
<?php $album = newAlbum("places/lokalisiert.alb"); if (is_object($album)) { makeAlbumCurrent($album); } ?>As soon as I enable the Tidy Assets plugin, the map will not be loaded.
What makes me wondering:
On the image page the map is displayed fine - even with the plugin enabled
Any JS errors perhaps? Btw, you either pass the album object or you make it current without passing it.
What I see in the console:
Uncaught ReferenceError: L is not defined
But I have no idea how to fix this.
Please remove all parameters when making the album current. That would be the normal album page usage.
makeAlbumCurrent()
will not load the page.
Could you point me in the right direction?
I was referring to the
printOpenStreetMap()
call. Either you pass an album object to it or you use the current album.changed the code to:
<?php $album = newAlbum("places/lokalisiert.alb"); printOpenStreetMap(NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, $album); ?>
which makes the map display fine. Until I enable the plugin. Then the uncaught refereneError is back and no map is displayed
Sorry, I really can't help with the plugin itself as I never used it. I mean it has a disclaimer that it may not work with every script.
No Problem :-)
Have you tried the absolute URL to exclude leaflet.js?
https://www.ralf-kerkhoff.de/zp-core/zp-extensions/openstreetmap/leaflet.js
Yes,
but that doesnt fix the problem.
Probably the author @bic can help better here.
Just tried your setup with the zenpage theme, a dynamic album and the tidy-assets plugin enabled. Everything works like it should.
It seems, that it is the album.
I have created the album this way:
https://www.vincentbourganel.fr/news/map-of-geo-localized-pictures/
If I choose another dynamic album the map is displayed fine.
Then your album respectively the images perhaps don't not have valid geodata available. In 1.5.8 then the map would not show.
mhh, without the tidy plugin activated the map displays fine.
So my guess is that the "Word Criteria" which is * makes the problem.
Check perhaps if the album created has images at all.
it has about 2500 images.
Did you perhaps put the code to call the OpenStreetMap in the page codeblock 1 ?
If so, remove it from codeblock 1 and copy it to codeblock 3
The multiverse theme has
printCodeblock(1)
in the<head>
section and sinceprintOpenStreetMap()
also prints a<div>
element you could be in trouble because that is not allowed in the<head>
section.If you look at
pages.php
in the multiverse theme you'll see thatprintCodeblock(3)
is called after the page content.hi,
I will try it when I am back in my pc
That does not fix problem - Either it is because of the * as the search word or some of the images have invalid geo data. Will try to go deeper next weekend.
Hi @Ralf, sorry for the late reply, I don't visit this forum so often sadly and for some reasons notifications are not working at the moment. Anyway, I can't reproduce the issue. On my side, when I add that path to the exclusions the leaflet.js file is not moved at all. But even if it was moved, it should always be loaded before inline scripts, not giving that error anyway. Can you provide a link to your album? Even privately if you wish.