[SOLVED] use CGSmartImage within a UDT
[SOLVED] use CGSmartImage within a UDT
I have not found the way nor in a forum topic about using CGSmartImage within a User Defined Tag. Is it possible? How?
Last edited by uloloi on Wed Oct 09, 2013 8:16 pm, edited 1 time in total.
Re: use CGSmartImage within a UDT
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: use CGSmartImage within a UDT
Pretty nice!, very useful ... thanks Rolf
Just something else. I needed to print a html tag, so instead of use smarty->display use display->fecth to compose a string
................
$str .= "<div rel='" . $key ."' class='huge-slide mi-".$theme_class."'";
$str .= "data-cycle-...";
$str .= ">\n"; // end div
$img_data = "{CGSmartImage src='".$val['img1']."' filter_watermark=1}";
$fetch_img = $smarty->fetch('eval:'.$img_data);
$str .= $fetch_img; // "<img src='". $val['img1'] ."'>";
if(isset($val['overlay'])){$str .= "<div class='caption huge-slide mi-".$theme_class."'>".$val['overlay']."</div>";}
$str .= "</div>\n";
Thanks a lot!
Just something else. I needed to print a html tag, so instead of use smarty->display use display->fecth to compose a string
................
$str .= "<div rel='" . $key ."' class='huge-slide mi-".$theme_class."'";
$str .= "data-cycle-...";
$str .= ">\n"; // end div
$img_data = "{CGSmartImage src='".$val['img1']."' filter_watermark=1}";
$fetch_img = $smarty->fetch('eval:'.$img_data);
$str .= $fetch_img; // "<img src='". $val['img1'] ."'>";
if(isset($val['overlay'])){$str .= "<div class='caption huge-slide mi-".$theme_class."'>".$val['overlay']."</div>";}
$str .= "</div>\n";
Thanks a lot!
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: [SOLVED] use CGSmartImage within a UDT
It's bad form to output html code from a UDT like that. That's what smarty is for. PHP is perfect for advanced logic. Smarty is for display level stuff.
ALL of that code could be done in a single GCB.
ALL of that code could be done in a single GCB.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


