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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:20:21
Script start
Timing: Jan 18 2025 10:20:21
Module start 'layout'
Timing: Jan 18 2025 10:20:21
Module start 'content'
Timing: Jan 18 2025 10:20:23
Module end 'content'
Timing: Jan 18 2025 10:20:23
Script end

Main resources:

Total runtime1.4389 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.4453152.6250
Module start 'layout' 0.00620.0028 742.070339.4453
Module start 'content' 0.00901.4282 781.5156574.1563
Module end 'content' 1.43720.0016 1,355.671920.1563
Script end 1.4388  1,375.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2326160.0002
Check MTime0.00130.0912160.0001
Mysql Total
Database connection0.00130.086910.0013
Mysqli_queries1.339793.1075690.0194
Looping result0.00080.0543670.0000
Template Total1.405097.620.7025
Template load0.00230.158720.0011
Template processing1.402597.475820.7013
Template load and register function0.00010.008010.0001
states
state_id_array0.00080.058210.0008
state_identifier_array0.00160.109920.0008
Override
Cache load0.00210.1434760.0000
Sytem overhead
Fetch class attribute can translate value0.00130.090020.0006
Fetch class attribute name0.00190.134090.0002
XML
Image XML parsing0.00890.621220.0045
class_abstraction
Instantiating content class attribute0.00000.0026140.0000
General
dbfile0.00980.6791220.0004
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
7content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 44
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs