building an image gallery

Author Message

mihnea stoian

Monday 05 January 2004 9:20:09 am

I'm trying to build an image gallery where I have a initial list of thumbnails and when I click on the individual thumbnail a pop-up opens with the bigger image.

What kind of template will I need for the list of images so that when clicked they open their corresponding bigger image?

I'm new to eZ (been using it for less than a month), and am still learning as I go, so could anyone tell me if there is some sort of tutorial on how to do something like this, or at least just part of it?

Thanks,

Mihnea

Paul Borgermans

Monday 05 January 2004 10:26:27 am

If you want a popup, best use some simple javascript mixed with template code like

-----------------------------------------------
....
<h3><a href="#">Preview <img src={"viewmag+.gif"|ezimage} onClick='OpenWindow({$node.object.data_map.preview.content[original].full_path|ezroot},"image_preview","scrollbars,resizable");'></a></h3>

------------------------------------------------------

you will probably need to change preview to the attribute name of your image.

viewmag+.gif is just an icon i borrowed from a KDE distribution and converted to gif (for IE transparancy)

the OpenWindow javascript function called is found in the default pagelayout in the demo's:

<script language="JavaScript">
<!--

function OpenWindow ( URL, WinName, Features ) {
popup = window.open ( URL, WinName, Features );
if ( popup.opener == null ) {
remote.opener = window;
}
popup.focus();
}

// -->

</script>

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

mihnea stoian

Tuesday 06 January 2004 7:05:54 am

thanks for the answer, but unfortunately it doesn't work for me. :(

{$node.object.data_map.preview.content[original].full_path|ezroot} doesn't seem to display anything, so there is no url to open the new window with.

your example included the same image as thumbnail for all the pop-ups. I'd like to be able to use ImageMagick to display a small thumbnail of the image, and when I click on this small image to open the bigger version of the same image.

could that be easily achieved? also, where can I find some sort of reference to all the eZpublish commands available?

thanks again,

mihnea

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 19 2025 00:58:00
Script start
Timing: Jan 19 2025 00:58:00
Module start 'layout'
Timing: Jan 19 2025 00:58:00
Module start 'content'
Timing: Jan 19 2025 00:58:01
Module end 'content'
Timing: Jan 19 2025 00:58:01
Script end

Main resources:

Total runtime0.8654 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.1563152.6250
Module start 'layout' 0.00570.0040 741.781339.4453
Module start 'content' 0.00970.8544 781.2266537.6719
Module end 'content' 0.86410.0012 1,318.898412.1641
Script end 0.8654  1,331.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4165160.0002
Check MTime0.00150.1744160.0001
Mysql Total
Database connection0.00060.064110.0006
Mysqli_queries0.808693.4338570.0142
Looping result0.00070.0777550.0000
Template Total0.827095.620.4135
Template load0.00270.314120.0014
Template processing0.824395.248820.4121
Template load and register function0.00010.013010.0001
states
state_id_array0.00190.214010.0019
state_identifier_array0.00290.340720.0015
Override
Cache load0.00220.2532380.0001
Sytem overhead
Fetch class attribute can translate value0.00070.085320.0004
Fetch class attribute name0.00150.177740.0004
XML
Image XML parsing0.00070.078920.0003
class_abstraction
Instantiating content class attribute0.00000.000940.0000
General
dbfile0.00080.0950170.0000
String conversion0.00000.000940.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs