Dit is een Nederlandse categorie binnen dit forum. Hier kun u vragen stellen, antwoorden geven en opmerkingen plaatsen in het Nederlands.
De items in het Engelstalige forum deel worden hier niet automatisch geplaatst. Wanneer u hier geen antwoord vindt kunt u ook de Engels- (of anderstalige) categorie raadplegen.

path to image

  • rhvanloenen
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
12 jaren 2 maanden geleden - 12 jaren 2 maanden geleden #1878 door rhvanloenen
path to image werd gestart door rhvanloenen
with the property image I use FileLocation + 'media/10.JPG'
with script in textfield I use <img src="http://localhost/xertetoolkits/USER-FILES/1-guest2-Nottingham/media/10.JPG"/>

But making a html-export the path of the script doesn't exist anylonger when zip is unpacked on another laptop.

Now I tried to rewrite the sript, but I do something wrong? What wil be the correct script of:
<img src="/media/10.JPG" >

Ronald
Laatst bewerkt 12 jaren 2 maanden geleden door rhvanloenen.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • rhvanloenen
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
12 jaren 2 maanden geleden - 12 jaren 2 maanden geleden #1885 door rhvanloenen
Beantwoord door rhvanloenen in topic path to image
Found the solution:
<img src="/media/10.JPG"> has to be <img src="./media/10.jpg"/>
The point before the first /

Caution. This script only works when LO is accessed through a browser, either locally or updated anywhere on the Internet.
It does not work with review in XOT itself!

After finishing the LO, I make a copy of the LO in Xot.
Then I go to the user folder in xampp/htdocs.... and in data.xml and preview.xml and use find and replace the original image script into the new one.

<img src="http://localhost/xertetoolkits/USER-FILES/1-guest2-Nottingham/media/10.JPG"/>
will be
<img src="./media/10.JPG">

Exporting this LO for use.

Be carefull, don't mixed up the two learning objects that you have now. Fitrst is the original.
Laatst bewerkt 12 jaren 2 maanden geleden door rhvanloenen.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
12 jaren 2 maanden geleden #1889 door JohnSmith
Beantwoord door JohnSmith in topic path to image
Thanks Ronald for reminding me of this...

And just for you... well obviously not JUST for you but you know what I mean...

If you add this code to your xenith.js file then it will fix the issue once and for all... hopefully...

At around line 900 in the latest version (might be slightly different in yours) you should see a function:
Code:
function x_pageLoaded() { x_pageInfo[x_currentPage].built = $("#x_page" + x_currentPage); $("#x_page" + x_currentPage) .hide() .css("visibility", "visible") .fadeIn(); }

Change this to:
Code:
function x_pageLoaded() { x_pageInfo[x_currentPage].built = $("#x_page" + x_currentPage); $("#x_page" + x_currentPage + " img").each(function(index) { var $this = $(this), src = $this.attr("src"); if (src.substring(0, 16) == "FileLocation + '") { src = eval(src); } $this.attr("src", src); }); $("#x_page" + x_currentPage) .hide() .css("visibility", "visible") .fadeIn(); }

This mean that you can use the exact same FileLocation + '.......' code in the main text and xenith will find and replace. Makes it a lot easier for this type of situation.

It works here but I will probably move this snippet somewhere more relevant later (just in case anyone is reading this retrospectively) and I will try to extend to work with other html tags like <a> <audio> <video> etc but this is a good start.

John
De volgende gebruiker (s) zei dank u: rhvanloenen

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • rhvanloenen
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
12 jaren 2 maanden geleden #1897 door rhvanloenen
Beantwoord door rhvanloenen in topic path to image
Thanks.
Tested with review, local and electronic learning environment of my school. Works fine!

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • rhvanloenen
  • Onderwerp Auteur
  • Offline
  • Premium lid
  • Premium lid
Meer
12 jaren 1 maand geleden #1935 door rhvanloenen
Beantwoord door rhvanloenen in topic path to image
I thought it worked and it did it on my own laptop. Also in the electronic learning environment, but using a different laptop it didn't work anymore. The path was found to be apparently referring to my laptop, and not to the the new file location.
So the problem is still there, but may be I'm doing something wrong.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: ingdonkatber
Tijd voor maken pagina: 0.133 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo