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.