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.

eZ debug

Timing: Jan 18 2025 04:07:45
Script start
Timing: Jan 18 2025 04:07:45
Module start 'content'
Timing: Jan 18 2025 04:07:45
Module end 'content'
Timing: Jan 18 2025 04:07:45
Script end

Main resources:

Total runtime0.1326 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.8516180.8281
Module start 'content' 0.00560.0034 769.6797102.1016
Module end 'content' 0.00890.1236 871.7813531.0469
Script end 0.1326  1,402.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00332.5148200.0002
Check MTime0.00130.9830200.0001
Mysql Total
Database connection0.00090.705110.0009
Mysqli_queries0.095371.84631410.0007
Looping result0.00110.86601390.0000
Template Total0.123493.010.1234
Template load0.00060.468910.0006
Template processing0.122892.570210.1228
Override
Cache load0.00040.338710.0004
Sytem overhead
Fetch class attribute can translate value0.00130.990810.0013
XML
Image XML parsing0.00020.177110.0002
General
dbfile0.00181.3289200.0001
String conversion0.00000.004530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs