Thursday 02 November 2006 1:21:55 pm
Hi Sagar
Just adapt the links to wherever you want them although the way you have it now is not correct either. I meant to surround the image with the a tag whereas you put it after the image tag which is not correct. Just think about it before you change the template.
Here the single steps: You want to display the image
<img src={$image.url|ezroot} width="{$image.width}" height="{$image.height}" {section show=$hspace}hspace="{$hspace}"{/section} style="border: {$border_size}px;" alt="{$image.text|wash(xhtml)}" title="{$image.text|wash(xhtml)}" />
Now you want to have a link on the image. That means you have to put the image inside a link tag. And since you might not always want a link you insert the link depending on whether there was a link target specified:
{section show=$href}
<a href={$href}{section show=and( is_set( $link_class ), $link_class )} class="{$link_class}"{/section}{section show=and( is_set( $link_id ), $link_id )} id="{$link_id}"{/section}{section show=$target} target="{$target}"{/section}>
{/section}
<img src={$image.url|ezroot} width="{$image.width}" height="{$image.height}" {section show=$hspace}hspace="{$hspace}"{/section} style="border: {$border_size}px;" alt="{$image.text|wash(xhtml)}" title="{$image.text|wash(xhtml)}" />
{section show=$href}
</a>
{/section}
Now you think that the image might not always be there and you want to display the html for the image only if there is a real image available.Therefore you put the code in an additional conditional statement:
{section show=and( is_set( $image ), $image )}
{section show=$href}
<a href={$href}{section show=and( is_set( $link_class ), $link_class )} class="{$link_class}"{/section}{section show=and( is_set( $link_id ), $link_id )} id="{$link_id}"{/section}{section show=$target} target="{$target}"{/section}>
{/section}
<img src={$image.url|ezroot} width="{$image.width}" height="{$image.height}" {section show=$hspace}hspace="{$hspace}"{/section} style="border: {$border_size}px;" alt="{$image.text|wash(xhtml)}" title="{$image.text|wash(xhtml)}" />
{section show=$href}
</a>
{/section}
{/section}
{section show=$foo}
...
{/section}
is the deprecated version of
{if $foo}
...
{/if} which works like a usual if condition. The code within such a condition is only executed if the condition evaluates to true (which it usually does if the variable has some content at all)
Regarding the image problem itself: The default imageclass is only used if you do not specify another imageclass in the attribute_view_gui function. So make sure the imageclass parameter in the image.tpl (NOT in the ezimage.tpl you just posted) it set to large (for testing). I have just seen that the image.ini.append.php in the override folder must be there to provide the path to imagemagick. On a windows machine this should look like this:
[ImageMagick]
IsEnabled=true
ExecutablePath=d:\imagemagick-6.2.6-q16
Executable=convert.exe
probably followed by some alias settings. So first make sure that the path is correct depending on wherever imagemagick is located on your server and enable the file again. Clear the cache and try again. If you still don't get any image the permissions for the var/<site_access>/storage/images/ folder are wrong or ez is not allowed to use imagemagick or something else is happening that I don't have the slightest clue about. Unfortunately I cannot help you with any of these problems so good luck with troubleshooting... Maybe (hopefully...) I have just missed a very simple reason for your problem but I really don't know any other possible reasons right now. Good luck Claudia
|