Basic content_image usage not working
Posted: Thu Oct 15, 2009 9:41 pm
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
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Ā

( $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