Forums / Setup & design / $border_size variable

$border_size variable

Author Message

paul bolger

Tuesday 10 July 2007 9:23:26 pm

ezimage.tpl gets the border width for an image from a variable called $border_size - how does one set this variable? I can't find any reference to it in the documentation, the forums, or the ini files.

Paul Bolger

Betsy Gamrat

Thursday 12 July 2007 9:05:40 am

Paul,

Use this command:

grep -r "border_size" *

One of the files is:

design/standard/templates/content/datatype/view/ezimage.tpl

{*
 ... (other comments here) ...
 border_size   - Size of border around image, default is 0
*}
{default ... (other variables here) ...
         border_size=0}

When you call attribute_view_gui for the image, you can override the default border_size as follows:

{attribute_view_gui attribute=$node.data_map.image border_size=4}

Where <b>4</b> could be any value.

paul bolger

Sunday 15 July 2007 8:24:43 pm

Thanks Betsy.

I was sort of hoping that there was some undocumented mechanism to set this variable from the embed popup, so as to allow users to set a border when embedding an image.

I guess the other way of doing it would be to set a custom attribute and pull the result of that - all I have to do is work out how to get that value!

Paul Bolger

paul bolger

Thursday 11 February 2010 3:04:35 am

Two and a half years later and I'm back in the same place.

ezimage.tpl has the following:

<code>
{if $border_size|trim|ne('')}
{set $inline_style = concat( $inline_style, 'border: ', $border_size, 'px ', $border_style, ' ', $border_color, ';' )}
{/if}
</code>

Has the following:<code>$border_size, $border_style, $border_color</code>

Shouldn't they all be in the 'insert image' dialogue?

It looks to me like user border parameters got added at some previous stage, and then half dropped. I'm not a great believer in letting the editors muck around with the layout to that extent - I'd rather just have a border:yes|no option, and sort it out in the stylesheet - but this is just silly.

Paul Bolger