• Resolved z1pas

    (@z1pas)


    Hi,

    I’m creating an XML feed, using the custom XML format, that need to list images like this:

    <images>
    	<image>
    		<url>http://domain.com/imagefile.jpg</url>
    	</image>
    </images>

    There doesn’t seem to be a way to do this using the XML Editor, so I’ve taked a custom function and tried to modify it which looks like this:

    function image( $url = null) {
    	$i = 1;
    	$output = '';
    	foreach ( $url as $image ) {
    		$output .= '**LT**image id="' . $i . '"**GT**';
    		$output .= '**LT**url**GT**' . $image . '**LT**/url**GT**';
    		$output .= '**LT**/image**GT**';
    		$i++;
    	}
    	return $output;
    }

    But with this function I get only one result which looks like this:

    <images>
    	<image id="1">
    		<url>http://domain.com/imagefile.jpg</url>
    	</image>
    </images>

    Any help to get this working as needed would be greatly appreciated.

    Thank you,
    Aleksandr

    • This topic was modified 3 years, 11 months ago by z1pas.
    • This topic was modified 3 years, 11 months ago by z1pas.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Export Images as Nested Elements’ is closed to new replies.