MOD: Fateching image path and filename only

Version: 2.1



This Mod will allow you to set within the calling of the image.tpl but to only request the image path and filename rather than providing the tag with the data:



open: common_templates/image.tpl



find:


<br />
{if !(($object_type == "category" || $object_type == "detailed_category") && !$icon_image_path)}<br />
        <img class="{$valign} {$class}" {if $obj_id && !$no_ids}id="det_img_{$obj_id}"{/if} src="{$icon_image_path|default:$config.no_image_path}" {if $image_width}width="{$image_width}"{/if} {if $image_height}height="{$image_height}"{/if} alt="{$images.icon.alt}" {if $image_onclick}onclick="{$image_onclick}"{/if} border="0" /><br />
        {/if}<br />

```<br />
<br />
replace with:<br />
<br />
```php
<br />
{assign var="path_only" value=$path_only}<br />
    <br />
{if $path_only}<br />
    {$icon_image_path|default:$config.no_image_path}<br />
{else}<br />
    {if !(($object_type == "category" || $object_type == "detailed_category") && !$icon_image_path)}<br />
        <img class="{$valign} {$class}" {if $obj_id && !$no_ids}id="det_img_{$obj_id}"{/if} src="{$icon_image_path|default:$config.no_image_path}" {if $image_width}width="{$image_width}"{/if} {if $image_height}height="{$image_height}"{/if} alt="{$images.icon.alt}" {if $image_onclick}onclick="{$image_onclick}"{/if} /><br />
    {/if}<br />
{/if}<br />

```<br />
<br />
example of calling from template just the image path and filename:<br />
<br />
{include file="common_templates/image.tpl" images=$banner.main_pair object_type="common" path_only=true}<br />
<br />
simply just add:<br />
<br />
path_only=true<br />
<br />
and your all done! hope this helps someone

And this should be implemented into CS asap.



Thank you sir!