Basic content_image usage not working

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
florin
New Member
New Member
Posts: 5
Joined: Sun Sep 27, 2009 7:07 pm

Basic content_image usage not working

Post by florin »

Hi,

just starting with cmsms, and I was looking on the content_image tag. I'm not sure I understand the exact meaning of the 'block' attribute of this tag, what does it's value refer to?
Because I was trying the basic {content_image block='image1' dir='images'} and it does not output anything. Actually it outputs an empty string  :). In file plugins/function.content_image.php at line 36 I think (I added some 'die' code to see the exact exit point), the condition
( $img == -1 || empty($img) ) is true, which causes this method to exit, returning nothig.

The more conclusiv lines of cose are:
A: $result = $smarty->fetch(str_replace(' ', '_', 'content:' . $params['block']), '', $pageinfo->content_id);
and
B: $img = _smarty_cms_function_content_return($result, $params, $smarty);

I'm not sure where the template is taken from at line A, but the value of $result is an empty string, and this together with the current implementation of _smarty_cms_function_content_return, which is:

if ( empty($params['assign']) )
{
return $result;
}
else
{
$smarty->assign($params['assign'], $result);
return '';
}

will cause the above condition (on $img) to be meet and so the method to exit because both $params['assign'] is not set and $result is  empty string.

I'm do not really understand what this code was suppose to accomplish, but is doesn't seem to accomplish anything.

I'm using version 1.66 (latest at this time).

Would appreciate if anyone can give my a hint on content_image...

Thanks,
florin
Post Reply

Return to “CMSMS Core”