multiple image sizes/classes within same array - frontpage tweaks

Author Message

steve walker

Tuesday 11 May 2004 11:54:49 am

Hi there,

In hope of some help I submit to the forum!! My problem is not very different from the thread found in:

http://www.ez.no/community/forum/setup_design/different_imagesizes_on_images_embedded_in_an_xml_text_field

...but the answer wasnt clear for me, so hopefully someone could give some pointers...

My problem is this: I have a frontpage which displays latest news articles ala the 'news template' with Ez. The first article listed uses the 'image_class=medium' in the line template overide. The problem that I have is the consequtive articles in the page then want 'image_class=small' to be applied.

The code in article_line.tpl is:

{default content_object=$node.object
content_version=$node.contentobject_version_object}

<div class="image">{attribute_view_gui attribute=$node.object.data_map.thumbnail image_class=medium alignment=left href=$node.url_alias|ezurl}</div>

<div class="info">
<h2>{attribute_view_gui attribute=$content_version.data_map.title}</h2>

<div class="object_brief">
{attribute_view_gui attribute=$content_version.data_map.intro}
<a href={$node.url_alias|ezurl}><img src={"design/news/images/read-more_dark.gif"|ezroot} ALT="read more"></a>
</div>

</div>
</div>

I need to add something on the lines of "if this is number Y in the section sequence, then make the 'image_class=XXX"?

Anyone got any ideas??

...something aside - I think I have seen this in previous thresd - but why dont Ez crew start a payment scheme for questions like these? Similar to the google answers model?

Anyway, help on this would be greatly appraciated.

Thanks, Steve.

http://www.oneworldmarket.co.uk

steve walker

Wednesday 12 May 2004 1:44:55 am

Hi there,

No replies (as usual :((((( ), but live in hope...

I have started to try a work around to achieve the above. On my frontpage it references the 4 latest new articles. The first one is large format style, second two small format, and the fourth one is again large.

It used the 'line view' (article_view.tpl) to list the news items. What I have started doing is creating a new line view called 'mline' - I have put identical template override as article_view.tpl but have specified the smaller image.

However, when I try to use my new view I've created, debug gives message of:

"None of the templates design:node/view/mline.tpl could be found"

However, in my template admin panel I can clearly see 'Template view /node/view/mline.tpl' so it should be there??

Do I need to register this new view anywhere so that my line:

'{node_view_gui view=mline content_node=$news.item}' uses the new view it up as intended.

A quick reply or pointer would be greatly appreciated.

Steve.

http://www.oneworldmarket.co.uk

Alex Jones

Wednesday 12 May 2004 6:48:16 am

Steve, I don't think you have to register the mline template anywhere else. You mentioned that you can see the template in the admin view, but you may want to check that it is placed in the proper directory of your site view as well: /design/your_site/templates/content/view/mline.tpl.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

steve walker

Wednesday 12 May 2004 7:28:53 am

Alex, thankyou for the response.

I had the new view originally stored in:

/design/<name_of_site>/templates/node/view/mline.tpl

and I changed it as you said to

/design/<name_of_site>/templates/content/view/mline.tpl

but didnt get any change... still have message of: "one of the templates design:node/view/mline.tpl could be found".

The error message suggests it should be in 'node/view' rather than 'content/view'? Any other thoughts?

Thanks, Steve.

http://www.oneworldmarket.co.uk

Alex Jones

Wednesday 12 May 2004 7:43:23 am

Hrrrm, try using <i>{content_view_gui view=mline content_node=$news.item}</i> instead of <i>{node_view_gui view=mline content_node=$news.item}</i>, clear the cache and see if that helps.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

steve walker

Wednesday 12 May 2004 8:16:11 am

Alex,

Araid it then gives error: "Missing parameter content_object".

Is there anywhere I might have somehow configured an incorrect path in the ini files? I had to change the site name midway through build... I've tried making other new views for test purposes, but always same result.

Thanks, Steve.

http://www.oneworldmarket.co.uk

steve walker

Wednesday 12 May 2004 8:22:59 am

Alex,

Fixed it! I has the /var/* path set wrong in site.ini.append, have changed this and am now getting some sense back!

I'd like to thank you very much for your help, its been really appreciated.

Kind regards, Steve.

http://www.oneworldmarket.co.uk

Alex Jones

Wednesday 12 May 2004 8:42:07 am

I'm glad you are up and running!

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

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 20:08:03
Script start
Timing: Jan 19 2025 20:08:03
Module start 'layout'
Timing: Jan 19 2025 20:08:03
Module start 'content'
Timing: Jan 19 2025 20:08:04
Module end 'content'
Timing: Jan 19 2025 20:08:04
Script end

Main resources:

Total runtime1.1835 sec
Peak memory usage4,096.0000 KB
Database Queries72

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.4141152.6563
Module start 'layout' 0.00650.0023 742.070339.5234
Module start 'content' 0.00881.1731 781.5938599.6641
Module end 'content' 1.18190.0016 1,381.257820.0938
Script end 1.1835  1,401.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2774160.0002
Check MTime0.00130.1106160.0001
Mysql Total
Database connection0.00090.076610.0009
Mysqli_queries1.104893.3456720.0153
Looping result0.00070.0619700.0000
Template Total1.143696.620.5718
Template load0.00200.170520.0010
Template processing1.141696.455520.5708
Template load and register function0.00040.034110.0004
states
state_id_array0.00170.143910.0017
state_identifier_array0.00160.136320.0008
Override
Cache load0.00180.1539690.0000
Sytem overhead
Fetch class attribute can translate value0.00100.085420.0005
Fetch class attribute name0.00130.113790.0001
XML
Image XML parsing0.00060.050320.0003
class_abstraction
Instantiating content class attribute0.00000.0020110.0000
General
dbfile0.00140.1197160.0001
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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs