Re: A function like 'Fetch' but only grabs info inside a certain tag.

From: Date: Wed, 27 Feb 2002 00:25:25 +0000
Subject: Re: A function like 'Fetch' but only grabs info inside a certain tag.
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2853@lists.php.net to get a copy of this message
--- WiL Laxa <wlaxa@blendermedia.com> wrote: > So you can do this... > --------- > $smarty = new Smarty; > $smarty->assign('Name',$name); > $body = $smarty->capture('body','search.tpl'); > $smarty->clear_all_assign(); > $smarty->assign('body',$body); > $smarty->display('template.tpl'); Not as far as I know. I suggest you register a prefilter function (see documentation), to extract the page body before the template gets compiled. We use Smarty in conjunction with Roadsend Sitemanager. Site manager handles the master template including the <html><body> bits and smarty is used for the componants that slot into this master template. We also use MS Frontpage though :( which insists on putting the <html> tags back into our templates. The prefilter is used to remove these. Of course if could ever get my smarty tal compiler working, you could use a macro to do this much more elegantly. But it's a long way off yet. Hope this helps. Richard Wall. ===== Richard Wall tel: 0794 1199105 PGP Key ID: 0xAC33A456 __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com

« previous php.smarty.general (#2853) next »