Fill array with image links?

This section can be used to submit suggestions for Extension Builder.
Note that this section is not monitored for support.
Forum rules
This forum section can be used to submit suggestions for Extension Builder.
Note that this section is not monitored for support.
Post Reply
smile
 
 
Posts: 160
Joined: Tue Oct 13, 2020 8:22 pm
Location: EU
Contact:

Fill array with image links?

Post 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?
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Fill array with image links?

Post by Pablo »

You can use a XSL template (dataset) to create a dynamic array.

Note that there is no support on programming.
smile
 
 
Posts: 160
Joined: Tue Oct 13, 2020 8:22 pm
Location: EU
Contact:

Re: Fill array with image links?

Post 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.
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Fill array with image links?

Post by Pablo »

The 'Photo book' example may be helpful:
https://www.wysiwygwebbuilder.com/forum ... hp?t=13743
smile
 
 
Posts: 160
Joined: Tue Oct 13, 2020 8:22 pm
Location: EU
Contact:

Re: Fill array with image links?

Post 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>
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Fill array with image links?

Post 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 .
smile
 
 
Posts: 160
Joined: Tue Oct 13, 2020 8:22 pm
Location: EU
Contact:

Re: Fill array with image links?

Post 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.
Last edited by smile on Sun Sep 04, 2022 11:14 am, edited 1 time in total.
smile
 
 
Posts: 160
Joined: Tue Oct 13, 2020 8:22 pm
Location: EU
Contact:

Re: Fill array with image links?

Post by smile »

My temp solution is this:
But how do I specify windows size? I have to resize it every time.
Image
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Fill array with image links?

Post 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".
smile
 
 
Posts: 160
Joined: Tue Oct 13, 2020 8:22 pm
Location: EU
Contact:

Re: Fill array with image links?

Post 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?
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Fill array with image links?

Post by Pablo »

Per file basis?
Yes
Post Reply