|
From: Ben C. <php...@be...> - 2002-04-08 11:47:05
|
Oh, and there was another vote for wrap instead of header/footer on the
sourceforge forum so let's say 1 for header/footer and 2 for wrap.
On Sun, Apr 07, 2002 at 09:09:56PM +0100, John Wilkins wrote:
> Hi all,
>
> I've been testing out the latest CVS code including the new smarty
> templates. They certainly make the php code files a lot simpler which
> is, I think, Ben's main aim of the change.
>
> A couple of weeks ago, I started to build a new template for my install
> at work. With the pre-Smarty code, this was straight forward: Design
> a new wrap.html in any html wysiwyg editor than put in the correct
> tags for {content} etc,. I didn't make any changed to the "content"
> files (user.html, newaccout.html) etc,,.
>
> Having looked at the new templates system, I was wondering if it would
> be possible to still use an overall design template file (ie wrap.html)
> with the new Smarty "content" files.
>
> I think I've found how to do this by making only very small changes
> to whats currently in cvs. The basic approach was to:
> * change the {content} tag in wrap.html to {include file=$content}
> * change the $t->display('index.html') line at the end of index.php
> to $t->display('wrap.html');
> * preceed the $t->display(..) line with
> $t->assign('body','index.html'); (or 'user.html' etc,,)
> * change index.html by removing the header and footer includes but
> leaving all the other smarty code in place;
> * copy back smarty display logic code from header.html and
> footer.html to wrap.html;
>
> The wrap.html basically becomes the overall "layout" template
> file whilst the others provide all the detail & display logic.
> Significantly distinct templates can be generated simply by
> modifying the wrap file, without having to change the others.
>
> Is this worth looking at? It seems to be a "middle way" to get
> the benefits of the old simple templates with the power of the
> Smarty template class. If so, I'll post my modified files here
> somewhere for closer inspection.
>
> _______________________________________________
> phpbt-dev mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/phpbt-dev
|