#1 April 28, 2014 4:11am

agustinus
Member
Registered: April 28, 2014
Posts: 2

Showing callout data from module selection

Hi all, I'm new in used this cms.

I have make some modules call it header module for each different month which is just contain an image,  as per month the images header for each month will be different.

After that i make callout which is base on this header modules as an resources field and i choose list for that so i can set the list field by using database populated and input the image store as a description.

When I'm using on template the header image list option is show like this {staticroot}files/image01.jpg which is the image that i input in the modules. but i can't loading the img source it's just show the image id not the source of image. So when i see the source code its just show like this <img src="1" title="" /> instead <img src="localhost/file/image01.jpg" title=""/>.

How can resolve this problems?? please help
Thanks

Offline

#2 April 28, 2014 9:32am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 970

Re: Showing callout data from module selection

The Database populated list field type returns the ID for the entry you choose in the callout. You will need to create a new class instance in your callout, something along these lines:

$headerMod = new SiteHeaders;
$header = $headerMod->get($callout["header"]);
echo '[img]'.$header["image"].'[/img]';

Offline

#3 April 28, 2014 8:59pm

agustinus
Member
Registered: April 28, 2014
Posts: 2

Re: Showing callout data from module selection

Hi Tim,

Thanks for your reply,
Now i have this error on page Fatal error: Class 'SiteHeaders' not found in E:\UwAmp\www\360\templates\callouts\monthly-header.php on line 6.

what i have put is like thisin my monthly-header.php(callout page)

<?
    /*
        Resources Available:
        "header" = Monthly Header - List
    */
$headerMod = new SiteHeaders;
$header = $headerMod->get($callout["mheader"]);
echo '<img src="'.$header["image"].'" alt="">';
?>

line six is $headerMod = new SiteHeaders.

Can you please write complete php script for that new class. I'm so newbie about thisThanks in advance

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.