PDA

View Full Version : ID icon.


Wondering
01-17-2009, 07:34 PM
Good Day One and All,

I am new here must say that after a couple of days of playing around I am starting to pick up on a few things but one thing that is beyond my knowledge is [MOD] programming.

I have found the Category Icon [MOD] and would like to do the same thing for the Link ID on the detail.php page. I know how to modify the Category code to go to a new image directory but I am not sure on what the code for the Link ID is. So would this be correct?

{if $ID eq 0}<img src="{$smarty.const.FULL_TEMPLATE_PATH}/images/link/{$ID}.png" border="0" align="left" style="margin-right: 10px; margin-top: 5px; margin-bottom: 5px;" />
{else}

If so then would I just have to insert in directly into the detail.php page so that;

$data['ID'] = $id;

Would not be

$data['ID'] = {if $ID eq 0}<img src="{$smarty.const.FULL_TEMPLATE_PATH}/images/link/{$ID}.png" border="0" align="left" style="margin-right: 10px; margin-top: 5px; margin-bottom: 5px;" />
{else}

I have no idea about programming and I am trying to teach myself from examples so please let me know if I am even close on this one.

Thanks.

Wondering
01-17-2009, 08:15 PM
Well after tying the above code I discovered that I was not even close. :o

But after more messing around I have figured it out!

I created a new directory under the template called link and loaded up some images into it (ie. 1.jpg, 2.jpg, etc.)

Then under the template I edit detail.tpl so that;

<td class="label" style="padding-top: 5px;">{l}ID{/l}:</td>
<td class="smallDesc" align="left" style="padding-top: 5px;"><b>{$ID}</b></td>

is now;

<td class="label" style="padding-top: 5px;">{l}ID{/l}:</td>
<td class="smallDesc" align="left" style="padding-top: 5px;"><img src="{$smarty.const.FULL_TEMPLATE_PATH}/link/{$ID}.jpg" /></td>

Now it works just the way that I wanted it. Have to play around with the padding to get the look right, but all depends on overall look and final size of link image.