Page 1 of 1

Fill array with image links?

Posted: Sat Sep 03, 2022 2:12 pm
by smile
Hello

Trying to build my for image rotator here
http://www.dynamicdrive.com/dynamicinde ... deshow.htm

extension, need to fill image array with image links

Image

How do I make this list fill in dynamic? Because now I have all these static entries ["$file1$"],["$file2$"],["$file3$"]
The become empty if undefined and script stalls at that position because they are empty, I want that there would not be variable at all if it is empty?

Re: Fill array with image links?

Posted: Sat Sep 03, 2022 2:48 pm
by Pablo
You can use a XSL template (dataset) to create a dynamic array.

Note that there is no support on programming.

Re: Fill array with image links?

Posted: Sat Sep 03, 2022 3:30 pm
by smile
Well if anyone can help with code then I will be thankful.
Otherwise I will just replace all array code with variable and paste code block by hand.

Re: Fill array with image links?

Posted: Sat Sep 03, 2022 3:54 pm
by Pablo
The 'Photo book' example may be helpful:
https://www.wysiwygwebbuilder.com/forum ... hp?t=13743

Re: Fill array with image links?

Posted: Sun Sep 04, 2022 7:50 am
by smile
Thank you for your kind reply, I adapted the code and it somewhat works, but I need to remove the trailing comma after very last image element.

I also did not find where "images" folder is changed?

My code looks like this:
Image

Code looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match='/'>
<xsl:for-each select="GALLERY/IMAGE">
<xsl:text>["</xsl:text>
<xsl:value-of select="FILENAME"/>
<xsl:value-of select="URL"/>
<xsl:text>"],
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Re: Fill array with image links?

Posted: Sun Sep 04, 2022 9:36 am
by Pablo
Sorry, I do not have any experience with removing the trailing space using XSL templates.
But maybe you find XSL examples via Google?

The images folder for specific file types can be changed in Tools -> Options -> Publish
It's also possible to do it for individually objects via the Object Manager .

Re: Fill array with image links?

Posted: Sun Sep 04, 2022 10:49 am
by smile
There is no Options in the menu of my extension builder. If you refer to WYSIWYG web builder Publish config, then
I do not want to change it. I wanted the image slideshow to publish images to it's own folder "imageslideshow" or to just store links in the array, no need to do with images anything.

Image

I need to remove the trailing comma not trailing space.

Re: Fill array with image links?

Posted: Sun Sep 04, 2022 10:54 am
by smile
My temp solution is this:
But how do I specify windows size? I have to resize it every time.
Image

Re: Fill array with image links?

Posted: Sun Sep 04, 2022 12:02 pm
by Pablo
If you refer to WYSIWYG web builder Publish config
Correct
I wanted the image slideshow to publish images to it's own folder "imageslideshow"
For the 'file property you can set 'publish file(s)' to use defined folder.

Do you mean the window size of the properties? This is currently not stored.

Note that there is no support for this tool. It is provided "AS IS".

Re: Fill array with image links?

Posted: Mon Sep 05, 2022 8:16 am
by smile
Do you mean the window size of the properties? This is currently not stored.
yes.
For the 'file property you can set 'publish file(s)' to use defined folder.
Per file basis?

Re: Fill array with image links?

Posted: Mon Sep 05, 2022 8:54 am
by Pablo
Per file basis?
Yes