Forums / Developer / Integrate flsh gallery into ezpublish

Integrate flsh gallery into ezpublish

Author Message

Romeo Antony

Friday 10 September 2010 8:16:11 am

Hi,

Have anyone integrated flash gallery like polaroid into ezpublish. Jquery based gallery is Ok.

But in flash based gallery image is loaded by an xml file.

I do not have any idea where do I put xml file and how it works with tpl file

since in template file, within javascript code is like this to load the xml file

//<![CDATA[
var so = new SWFObject("polaroid.swf", "polaroid", "100%", "100%", "8", "#FFFFFF");
// specify the url to the xml-file, default is photos.xml
so.addVariable("xmlURL","photos.xml");
so.write("fullscreendemo");
//]]>

Isn't possible to include flash gallery , Not jquery based gallery.

If it possible where do put xml file. Any one did this before. I have searched in the ezforum. But someo ne asked this question few years back .but no reply. Hope Someone going to help .

Romeo

Gabriel Finkelstein

Monday 13 September 2010 10:42:14 am

Is it a static or dynamic xml?

If it's static, then upload the xml to your javascript folder and use

so.addVariable("xmlURL",{"javascript/photos.xml"|ezdesign});

If it is dynamic, create a new pagelayout_photos.tpl, generate the xml structure there, and create a new layout in layout.ini. And then use:

so.addVariable("xmlURL",{"layout/set/photos/Uri/To/Photos"|ezurl});

Romeo Antony

Monday 13 September 2010 2:59:51 pm

Gabriel, thanks a for your reply .

It is a static xml file. Following is the code for photos.xml

<?xml version="1.0" encoding="utf-8"?>
<photos>
<!-- Plase your photos here -->
<photo desc="Picture is from stock.xchng" url="_pics/1.jpg" />
<photo desc="Picture is from stock.xchng" url="_pics/2.jpg" />
</photos>

so I got u.

in the above code pictures wll be loaded like

<photo desc="Picture is from stock.xchng" url={"_pics/1.jpg" |ezimage}/>
<photo desc="Picture is from stock.xchng" url={"_pics/2.jpg"|ezimage} />

It will be took from the image dir of design folder. Is that correct?

Frankly I didn't get your second explanation about dynamic xml file.

Gabriel ,can u plz give a line of code to understand will be helpfull

Romeo.

Gabriel Finkelstein

Monday 13 September 2010 3:41:45 pm

If you use {"_pics/1.jpg" |ezimage}, then it's not static anymore. Static would be:

<?xml version="1.0" encoding="utf-8"?>
<photos>
<photo desc="Picture is from stock.xchng" url="/design/mysite/images/_pics/1.jpg" />
<photo desc="Picture is from stock.xchng" url="/design/mysite/images/_pics/2.jpg" />
</photos>

If you want to use the ezimage operator, then you must use the dynamic way (ie. use a template).

What you have to do is go to layout.ini and add the following

[photos]
PageLayout=pagelayout_photos.tpl
ContentType=text/xml

Create a pagelayout_photos.tpl file in your template folder and put this in:

<?xml version="1.0" encoding="utf-8"?>
<photos>
<photo desc="Picture is from stock.xchng" url={"_pics/1.jpg"|ezimage} />
<photo desc="Picture is from stock.xchng" url={"_pics/2.jpg"|ezimage} />
</photos> 

And when you call your xml, use:

so.addVariable("xmlURL",{"layout/set/photos"|ezurl});

Romeo Antony

Tuesday 14 September 2010 2:26:29 am

Perfect.Thanks a lot for your detail reply Gabriel. I got you.

after that just only need to put this javascript code in some a templte?

in sometemplate.tpl

<script type="text/javascript">

<literal>

so.addVariable("xmlURL",{"layout/set/photos"|ezurl})

</literal>

</script>

So when this template executes, it will take pagelayout_photos.tpl

that contain ezimage types.

Gabriel Finkelstein

Tuesday 14 September 2010 10:17:03 am

Actually, you'll have to use:

<script type="text/javascript"> 
//<![CDATA[
var so = new SWFObject("polaroid.swf", "polaroid", "100%", "100%", "8", "#FFFFFF");
so.addVariable("xmlURL",{"layout/set/photos"|ezurl});
so.write("fullscreendemo");
//]]> 
</script>

Romeo Antony

Thursday 16 September 2010 4:03:55 am

Thanks a lot Gabriel. Great help.