Forums / Setup & design / multiple image sizes/classes within same array - frontpage tweaks

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>

eZ debug

Timing: Jan 19 2025 15:10:03
Script start
Timing: Jan 19 2025 15:10:03
Module start 'content'
Timing: Jan 19 2025 15:10:04
Module end 'content'
Timing: Jan 19 2025 15:10:04
Script end

Main resources:

Total runtime0.7612 sec
Peak memory usage4,096.0000 KB
Database Queries209

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 589.2266180.7969
Module start 'content' 0.00670.6512 770.0234600.7734
Module end 'content' 0.65790.1032 1,370.7969345.0547
Script end 0.7611  1,715.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5185210.0002
Check MTime0.00150.1909210.0001
Mysql Total
Database connection0.00080.104810.0008
Mysqli_queries0.684089.85122090.0033
Looping result0.00170.22712070.0000
Template Total0.731196.020.3656
Template load0.00220.283620.0011
Template processing0.728995.760820.3645
Template load and register function0.00020.027210.0002
states
state_id_array0.00100.130210.0010
state_identifier_array0.00080.108720.0004
Override
Cache load0.00190.2474690.0000
Sytem overhead
Fetch class attribute can translate value0.00080.106630.0003
Fetch class attribute name0.00100.128890.0001
XML
Image XML parsing0.00090.111930.0003
class_abstraction
Instantiating content class attribute0.00000.0030110.0000
General
dbfile0.00801.0455270.0003
String conversion0.00000.000830.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs