Forums / Setup & design / Display a image in different size ?

Display a image in different size ?

Author Message

Norman Leutner

Thursday 07 October 2004 12:46:21 am

Hello together.

Does anybody know how to display a image in different size than the image class sizes?

Currently I`m using:

{attribute_view_gui attribute=$News:item.data_map.image image_class="small"}

within the template.

Now I need to display the image in some sizes that doesn`t match my image classes.

ini defined classes:
SmallSizeWidth=100
SmallSizeHeight=100
MediumSizeWidth=300
MediumSizeHeight=300
LargeSizeWidth=450
LargeSizeHeight=450
ReferenceSizeWidth=600
ReferenceSizeHeight=600

Is there a way to use custom width and height like in the <IMG> Tag?
Or a way to get the direct image link to use the <IMG> tag?

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Silke Fox

Thursday 07 October 2004 12:54:47 am

Hi Norman,

You can define custom image sizes, see
http://ez.no/ez_publish/documentation/customization/components/images/changing_default_image_sizes

silke

Norman Leutner

Thursday 07 October 2004 1:21:16 am

Thanks Silke,
but I`m running 3.1 and adding own classes works with version > 3.2

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Silke Fox

Thursday 07 October 2004 1:58:45 am

Hm, I don't know how difficult it would be to take this feature from 3.2 or if there is a "clean" solution for this on 3.1.
A very dirty solution would be to pass width or height as parameter to the image attribute view template, like

{attribute_view_gui attribute=$News:item.data_map.image image_class="medium" width="280"}

This will of course not make use of the image conversion system, but resize it on client size.

Hopefully someone around here has a better solution... ;)

Norman Leutner

Thursday 07 October 2004 2:35:40 am

The bypassed width attribute also doesn`t work.
This seems to be a bigger problem within 3.1

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Silke Fox

Thursday 07 October 2004 4:43:19 am

Sorry, this was of course not the full story... ;)

Did you change the template that is used to show the image, i.e.
design\<yourdesign>\templates\content\datatype\view\ezimage.tpl?

Height and width are normally derived from the image alias, this should be changed to the passed parameter.

Norman Leutner

Tuesday 12 October 2004 11:47:01 pm

No, I didn`t.

{section show=and(first_set($attribute.content,true()),first_set($attribute.content.contentobject_attribute_id,false()))}
  {default image_class=large
    alignment=false()
    hspace=false()
    border_size=0}
    {let image_content=$attribute.content
         image=$image_content[$image_class]}
      {switch match=ezini('FileSettings','StorageDir')}
        {case match='storage'}
          <img src={$image.full_path|ezroot} width="{$image.width}" height="{$image.height}" {section show=$hspace}hspace="{$hspace}"{/section} {section show=$alignment}align="{$alignment}"{/section} border="{$border_size}" alt="{$image_content.alternative_text|wash(xhtml)}" />
        {/case}
        {case}
          <img src="/extensions/imagepassthrough/imagepassthrough.php3?imagepath={$image.full_path}" width="{$image.width}" height="{$image.height}" {section show=$hspace}hspace="{$hspace}"{/section} {section show=$alignment}align="{$alignment}"{/section} border="{$border_size}" alt="{$image_content.alternative_text|wash(xhtml)}" />
        {/case}
      {/switch}
    {/let}
  {/default}
{/section}

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh