• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: ProcessTemplate
PostPosted: Thu Mar 02, 2017 6:37 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Mar 24, 2011 12:37 am
Posts: 75
Hi Guys, i'm able to display the template but is it possible to convert it into a string to be emailed or echoed?

Code:
$tpl_ob = $smarty->CreateTemplate($this->GetTemplateResource($somestring));
$tpl_ob->assign('foo','bar');
$tpl_ob->display();


is there something i can use instead of $tpl_ob->display() ?

also, is there a way to process Content Blocks as templates?
Thanks for the help


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: ProcessTemplate
PostPosted: Thu Mar 02, 2017 6:48 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7789
Location: Fernie British Columbia, Canada
Code:
$out = $tpl_ob->fetch();

_________________
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: ProcessTemplate
PostPosted: Thu Mar 02, 2017 6:57 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Mar 24, 2011 12:37 am
Posts: 75
Thanks.

Is there a way to process a Content Block as templates instead of a file?

{global_content name='Email 1 Template'}

$tpl_ob = $smarty->CreateTemplate($this->GetTemplateResource($somestring));


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: ProcessTemplate
PostPosted: Thu Mar 02, 2017 8:18 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7789
Location: Fernie British Columbia, Canada
Code:
$tpl = $smarty->CreateTemplate('cms_template:My Template Name');
$tpl->assign('foo','bar');
echo $tpl->fetch();

_________________
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting