This would certainly work, and I did consider it. The main reason I
didn't do it this way it because it leaves a little more of the display
stuff in the PHP. The main thing is the page titles. I know it's not a
really big deal, but it is nice to be able to do
$t->display('index.html'); rather than $t->assign(array('content' =>
'index.html', page_title => 'Home')); $t->display('wrap.html'); I know
this is getting down to the nit-picking level, but that's what I was
thinking. Now, I don't really have that big of a problem going that
route if others think it would be nicer to keep the wrap.html instead of
header.html and footer.html. It's not that big of a deal, really.
So let's say that there's one vote for header/footer and one vote for
wrap. Any other votes? :)
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
|