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

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 18 2025 16:12:18
Script start
Timing: Jan 18 2025 16:12:18
Module start 'layout'
Timing: Jan 18 2025 16:12:18
Module start 'content'
Timing: Jan 18 2025 16:12:18
Module end 'content'
Timing: Jan 18 2025 16:12:18
Script end

Main resources:

Total runtime0.7097 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 587.9375152.6250
Module start 'layout' 0.00700.0027 740.562539.4453
Module start 'content' 0.00970.6982 780.0078591.7031
Module end 'content' 0.70800.0017 1,371.710920.1563
Script end 0.7097  1,391.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4822160.0002
Check MTime0.00150.2150160.0001
Mysql Total
Database connection0.00060.091410.0006
Mysqli_queries0.641390.3560690.0093
Looping result0.00060.0880670.0000
Template Total0.663993.520.3320
Template load0.00220.309620.0011
Template processing0.661793.235220.3309
Template load and register function0.00010.016910.0001
states
state_id_array0.00130.183310.0013
state_identifier_array0.00160.220820.0008
Override
Cache load0.00190.2706490.0000
Sytem overhead
Fetch class attribute can translate value0.00050.069720.0002
Fetch class attribute name0.00120.163580.0001
XML
Image XML parsing0.00060.088720.0003
class_abstraction
Instantiating content class attribute0.00000.0021110.0000
General
dbfile0.00630.8900170.0004
String conversion0.00000.001140.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/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
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 36
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs