Multiple Images in a content class

Author Message

Gert

Wednesday 26 November 2008 1:24:30 am

Hi,

In order to assign 5 images to a content class that will not be used anywhere else I would usually add 5 fields for images.

Is there a way to create some sort of an array of image fields so that the users decide how many images they want to upload and then read an array of uploaded images?

I'm now working on a project where up to 15 images should be uploaded, but sometimes it will just be one and I want to avoid to have 15 image upload fields in my content class.

Thanks in advance,

Gert.

canguro web solutions
consulting & development
http://www.canguro.at

Arnaud Lafon

Wednesday 26 November 2008 1:51:30 am

Hi Gert,

maybe you could use the "global object relation" using the form you have at the bottom of the content object edit page.

Then you can fetch that object using

fetch( 'content', 'related_objects', hash( 
'object_id',            object_id,
'all_relations', array( 'common' ) ))

Hope this helps

Arnaud

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

Gert

Wednesday 26 November 2008 2:26:55 am

Hi Arnaud,

Thank you very much for your soon reply and the detailed explanation!

As I understand the concept, using object relations means that users
would leave the content class form for each image they want to upload
and then come back.

As my users are very often little experienced I would prefer a method
where the user does not leave the form and possibly has just one or
two buttons to handle multiple image uploads. This is why at the moment
I have got 5 image upload fields, because it's a lot easier for my users
and when doing updates with great frequency it's also a lot faster.

What do you think?

Gert.

canguro web solutions
consulting & development
http://www.canguro.at

Arnaud Lafon

Wednesday 26 November 2008 4:24:40 am

Actually, your user won't leave the content edit page and will be redirected after they upload the image (as a new content object which can be uploaded under the current object this one is instanciated on a container class).

(Note that there was a bug on ezp 4.0 that missredirected the user on a blank page)

Looking for information about SQLI ?
Looking for a new job in Paris ?
Please contact me at alafon [at] sqli [dot] com

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 16:02:05
Script start
Timing: Jan 18 2025 16:02:05
Module start 'layout'
Timing: Jan 18 2025 16:02:05
Module start 'content'
Timing: Jan 18 2025 16:02:06
Module end 'content'
Timing: Jan 18 2025 16:02:06
Script end

Main resources:

Total runtime0.7175 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.9141152.6250
Module start 'layout' 0.00560.0024 740.539139.4453
Module start 'content' 0.00800.7083 779.9844547.9141
Module end 'content' 0.71630.0012 1,327.898412.1563
Script end 0.7175  1,340.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4321160.0002
Check MTime0.00130.1789160.0001
Mysql Total
Database connection0.00070.099410.0007
Mysqli_queries0.667292.9946600.0111
Looping result0.00050.0681580.0000
Template Total0.689096.020.3445
Template load0.00180.249620.0009
Template processing0.687295.781420.3436
Template load and register function0.00030.037310.0003
states
state_id_array0.00080.111210.0008
state_identifier_array0.00120.172020.0006
Override
Cache load0.00150.2146340.0000
Sytem overhead
Fetch class attribute can translate value0.00060.089320.0003
Fetch class attribute name0.00110.154950.0002
XML
Image XML parsing0.00060.085620.0003
class_abstraction
Instantiating content class attribute0.00000.002860.0000
General
dbfile0.00070.0955170.0000
String conversion0.00000.000840.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/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: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs