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

eZ debug

Timing: Jan 18 2025 22:20:20
Script start
Timing: Jan 18 2025 22:20:20
Module start 'content'
Timing: Jan 18 2025 22:20:20
Module end 'content'
Timing: Jan 18 2025 22:20:20
Script end

Main resources:

Total runtime0.8668 sec
Peak memory usage4,096.0000 KB
Database Queries206

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 588.8672180.8281
Module start 'content' 0.00860.7163 769.6953596.7813
Module end 'content' 0.72490.1418 1,366.4766341.0859
Script end 0.8667  1,707.5625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4521210.0002
Check MTime0.00140.1656210.0001
Mysql Total
Database connection0.00100.115410.0010
Mysqli_queries0.778489.80362060.0038
Looping result0.00220.25432040.0000
Template Total0.835196.320.4176
Template load0.00240.275520.0012
Template processing0.832796.073020.4164
Template load and register function0.00010.016310.0001
states
state_id_array0.00080.091510.0008
state_identifier_array0.00120.138820.0006
Override
Cache load0.00210.2405490.0000
Sytem overhead
Fetch class attribute can translate value0.00130.154330.0004
Fetch class attribute name0.00150.176180.0002
XML
Image XML parsing0.00100.112830.0003
class_abstraction
Instantiating content class attribute0.00000.0027110.0000
General
dbfile0.00260.3008280.0001
String conversion0.00000.001030.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 36
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs