[SOLVED] use CGSmartImage within a UDT

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
uloloi
Forum Members
Forum Members
Posts: 88
Joined: Thu Dec 16, 2010 8:50 pm

[SOLVED] use CGSmartImage within a UDT

Post by uloloi »

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.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: use CGSmartImage within a UDT

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
uloloi
Forum Members
Forum Members
Posts: 88
Joined: Thu Dec 16, 2010 8:50 pm

Re: use CGSmartImage within a UDT

Post by uloloi »

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!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: [SOLVED] use CGSmartImage within a UDT

Post by calguy1000 »

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.
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.
Post Reply

Return to “Modules/Add-Ons”