Forums / General / Multiple Images in a content class

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

eZ debug

Timing: Jan 30 2025 21:41:46
Script start
Timing: Jan 30 2025 21:41:46
Module start 'content'
Timing: Jan 30 2025 21:41:46
Module end 'content'
Timing: Jan 30 2025 21:41:46
Script end

Main resources:

Total runtime0.1684 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 587.9297370.2969
Module start 'content' 0.00720.0141 958.22661,005.6250
Module end 'content' 0.02130.1471 1,963.85163,893.8359
Script end 0.1684  5,857.6875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00442.6175200.0002
Check MTime0.00140.8504200.0001
Mysql Total
Database connection0.00080.459010.0008
Mysqli_queries0.086651.42781410.0006
Looping result0.00110.62831390.0000
Template Total0.146787.110.1467
Template load0.00080.459510.0008
Template processing0.145986.613110.1459
Override
Cache load0.00050.320610.0005
Sytem overhead
Fetch class attribute can translate value0.00170.995810.0017
XML
Image XML parsing0.00020.123410.0002
General
dbfile0.00442.6073200.0002
String conversion0.00000.003130.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