Ticket #3823 (closed Bug: fixed)

Opened 9 years ago

Last modified 5 years ago

document_actions need to be more flexible

Reported by: spliter Owned by:
Priority: minor Milestone: 2.1
Component: Templates/CSS Version:
Keywords: Cc:

Description

Dimensions of the images in document_atcions are hardcoded in document_actions, so designer needs to alter that template if he uses images with the dimensions that differ. I suggest to replace the code (document_actions):

<img i18n:attributes="title" src="" alt="" title=""

height="16" width="16" tal:condition="icon" tal:attributes="src string:$portal_url/$icon;

title title; alt title" />

with the following:

<img i18n:attributes="title" src="" alt="" title=""

height="16" width="16" tal:condition="icon" tal:define="iconImage python:portal.restrictedTraverse(icon)" tal:attributes="src string:$portal_url/$icon;

title title; alt title; height iconImage/height; width iconImage/width" />

Change History

comment:1 Changed 9 years ago by optilude

  • Status changed from new to closed
  • Resolution set to fixed

I've moved the height/width specification to cSS. This way you can customise the CSS if you need to. If you want *different* sizes of each image, you'll still have to customise the template, but that's a marginal enough usecase to warrant it. The advocated approach requires a restrictedTraverse() for each image, which is unnecessarily slow for something that'll say 16x16 in > 90% of the use cases anyway.

Martin

comment:2 Changed 5 years ago by hannosch

  • Component changed from Visual and templates to Templates/CSS
Note: See TracTickets for help on using tickets.