Forums / Setup & design / How to display more than 1 object in 1 clic ?

How to display more than 1 object in 1 clic ?

Author Message

laurent le cadet

Thursday 28 August 2003 11:41:23 pm

Even if eZ P don't make the coffee, It's very open and powerfull to do nearly what ever we want.

But I'm not sure it's possible to display 2 differents objects in 1 clic...
I have a main menu on the left of the screen with links to info pages {$module_result.content} and a cell just below with a generic image. What I want to do is to change both the image and the info page in the same clic...

Thanks for help.

Bjørn Kaarstein

Friday 29 August 2003 12:18:47 am

You could try to use the element view, something like this.

{section loop=fetch('content', 'list', hash('parent_node_id', $node.node_id,'class_filter_type', include, 'class_filter_array', array(2,8)))}

{node_view_gui view=element content_node=$:item}

{/section}

Here you fetch out instances of class 2 & 8. Now you can write overrides for element.tpl for both classes, and you'll have two changes in one click.

Hope this helps.

Regards Bjørn

laurent le cadet

Friday 29 August 2003 1:03:38 am

Thanks for repplying.

Actually I'm basically sorting contents like this :

{let article_list=fetch( content, list, hash( parent_node_id, 188, sort_by, array( array( priority )) ) )}

With the links like this :

{section name=Article loop=$article_list}
<a class="small" href={concat( "/content/view/full/", $Article:item.node_id,"/" )|ezurl}>{$Article:item.name|wash}</a>
{/section}

But I don't see How I can adapt your manner to my problem. It's not rather luminous for me.

More help ?

laurent.

laurent le cadet

Friday 29 August 2003 2:34:17 am

I wish I was born developper but I just have a designer brain.
I know I'm a bit greedy but it's the last step for a new eZ site...
May someone take my hand ?

Bjørn Kaarstein

Friday 29 August 2003 3:49:50 am

The image you're referring to... How is this loaded? Is it a static image like {<img src="pic.jpg"|ezimage>}, or do you fetch it from a class?

If you want to show a different picture for the different articles, you could use a switch/case statement matching on node.

Let's say you have articles with node_id 100, 101, 102 etc..

{switch match=$node.node_id}
{case match=100}
<img src={"pic_node_100.jpg"|ezimage}>
{/case}

{case match=101}
<img src={"pic_node_101.jpg"|ezimage}>
{/case}

{case}
<img src={"default_pic.jpg"|ezimage}>
{/case}

{/switch}

Regards Bjørn

laurent le cadet

Friday 29 August 2003 5:26:02 am

Bjørn,

Actually this is a static image.
In your example I understand that is not really dynamic, because you have to know per advance the ID of the node. It's ok for me but at the end I want the company I work for to do everythings by itself.

I'm not really sure but I think it's better to fetch images the same way than info pages (from db).

Am I right ?

Bjørn Kaarstein

Monday 01 September 2003 1:28:59 am

Hi.

No computing for me this weekend :)

My example wasn't very dynamic, so what I think you ought to do is the following.

Add one (or more) image field(s) to your article class, and fetch it out something like this:

{section show=ne($node.data_map.photo.content, 0)}
<img src={$node.data_map.photo.content[medium].full_path|ezroot} />
{/section}

This will display the image if it's added with the article. This will make it easy for your users to change these pictures themselves in the future.

Good luck!

Regards Bjørn.

laurent le cadet

Monday 01 September 2003 2:32:14 am

Hi Bjørn,

Was the WE ok ;-) ?

It works very well.
Just another question (maybe the last one), it don't seems to be possible to set the image size to "original" instead of medium.
No way ?

Thanks for working on my case.

Laurent

laurent le cadet

Monday 01 September 2003 2:54:46 am

There is a cache problem.
If I stay in the same section, it keeps on working well (most of the time !?!)
But if I change (a different page layout) and go back to the previous section, images don't appear anymore till I clean the content view cache :-(
Strange or normal ?

Bjørn Kaarstein

Monday 01 September 2003 3:42:50 am

Hi Laurent.

The weekend was very OK :)

<img src={$node.data_map.photo.content[original].full_path|ezroot} /> is working fine for me. If you can't get it to work, you can edit the ImageSettings in site.ini to adapt to your design.

I'm not quite sure on your cache problems, (Sounds strange, though...) but you could try to set viewcaching=disabled in site.ini.

Regards Bjørn

laurent le cadet

Monday 01 September 2003 5:45:27 am

Yes yes yes !

The problem with the [original] size was due to the cacheviewing setting.
I turned the cache off and now the size is ok and everything works fine.

Thanks.

Hope to meet you again ;-)

Laurent.

eZ debug

Timing: Jan 31 2025 04:16:02
Script start
Timing: Jan 31 2025 04:16:02
Module start 'content'
Timing: Jan 31 2025 04:16:02
Module end 'content'
Timing: Jan 31 2025 04:16:02
Script end

Main resources:

Total runtime0.2338 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.0041 588.0625180.8125
Module start 'content' 0.00410.0048 768.8750105.9297
Module end 'content' 0.00890.2249 874.8047534.2500
Script end 0.2338  1,409.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00271.1641200.0001
Check MTime0.00120.4923200.0001
Mysql Total
Database connection0.00050.218110.0005
Mysqli_queries0.191781.97131410.0014
Looping result0.00130.54371390.0000
Template Total0.224696.110.2246
Template load0.00070.305810.0007
Template processing0.223995.755510.2239
Override
Cache load0.00050.207510.0005
Sytem overhead
Fetch class attribute can translate value0.00090.376910.0009
XML
Image XML parsing0.00030.114610.0003
General
dbfile0.00713.0388200.0004
String conversion0.00000.001730.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