Search code examples
cmsmadesimple

CMS made simple, Ctlmodulemaker how to get the url of an image


hi I've made a simple module with CTLModuleMaker in CMS made simple, in the template I call the necessary items like this:

{assign var="item" value=$itemlist[0]}
{$item->name->Label()}: {$item->name}<br/>
{$item->image->Label()}: {$item->image}<br/>
{$item->image_text->Label()}: {$item->image_text}<br/>
{$item->image_desc->Label()}: {$item->image_desc}<br/>
{$item->img_thumb->Label()}: {$item->img_thumb}<br/>
{$item->catagory->Label()}: {$item->catagory}<br/>

as you can see i call an image with {$item->image} but when i try to do something like this {$item->url} it returns the url of the whole page I'm trying to get the url of the image not the whole page. any suggestions what i can do??


Solution

  • In a news template, it calls

    <img src="{$item->file_location}/{$item->image->value}" />

    You can also use {debug} to see all the variables being passed to the template in a separate popup window. This is my get out of jail free card when I can't find a field name.