This should be either easy or impossible, but somehow answer eludes me.
Help?
Assuming I have a picture loaded in files with name "name.jpg".
And I have a variable in the script:
var picname = "name.jpg"
[EOS] Loading picture at runtime from variable name
Re: [EOS] Loading picture at runtime from variable name
Even in a worst case scenario, you can still chain If commands with the image command as the Then and another If command as the Else. I didn't see any API methods to change images via javascript. You can check the reference guide yourself to see: https://milovana.com/eos/editor/help/api-reference
Re: [EOS] Loading picture at runtime from variable name
Best method I currently know that is possible would be to create a new page for each picture, and then use external script to mass create those pages directly into the json file.
I would end up with thousands of pages for large galleries and I'm not sure if that's the best way to do it performance wise.
Is there anything better?
I would end up with thousands of pages for large galleries and I'm not sure if that's the best way to do it performance wise.
Is there anything better?
-
- Explorer At Heart
- Posts: 560
- Joined: Sun Jul 06, 2014 2:11 pm
- Gender: Male
- Sexual Orientation: Open to new ideas!
- I am a: Slave
Re: [EOS] Loading picture at runtime from variable name
I had this problem once, I think I solved it with the if-chain-method, have one page for one picture and a huge if selecting the picture. I also generated the json code for that externally. The first time loading that page has a bit of a delay, but then it is fine. The only limit probably is the code size of the tease itself. I believe there is a limit on how large the json can be.
-
- Explorer
- Posts: 88
- Joined: Fri Aug 19, 2022 10:05 pm
Re: [EOS] Loading picture at runtime from variable name
You can have many images in one page and select one based on variable (as shown below). Variable can be set even before jumping to this page.
The problem is that all audio files from one page are loaded at once (that I checked). So I suspect that all images are also loaded at once. It would be more efficient to have one image per one page, but then you have annoying long list of pages in your tease. You must find a balance .
The problem is that all audio files from one page are loaded at once (that I checked). So I suspect that all images are also loaded at once. It would be more efficient to have one image per one page, but then you have annoying long list of pages in your tease. You must find a balance .
Who is online
Users browsing this forum: No registered users and 74 guests