Mailing List Archive

[Bricolage-General] templates and "media"
I've got a bunch of pre-existent Mason components that I'd like to use from
within Bricolage rather than having to hack them to death and turn them into
elements.

So I followed Dave Wheeler's tutorial at
http://sourceforge.net/mailarchive/message.php?msg_id=25761 and turned one
such component (my header) into a media element. I can preview this just
fine in the Media Profile, so that's good. It's URI is "/header.mhtml".

But now I have to be able to use this in another page, and I have to be able
to pass arguments to it...so I created a "Header" element that will handle
the gathering of all the arguments for "/header.mhtml".

I then created a template ("/header.mc") which has this as its source:

<& /header.mhtml,
title => $element->get_data('title'),
# other args follow
# .
# .
# .
&>

So now the question is, when I create a new story, how do I get it to use
the header.mc template? I got an autohandler to work just fine, but I'm not
seeing how to explicitly call a template.

What I'm aiming for, as I build this up and become more familiar with the
system, is to have two basic types of templates:

1. A bi-columnar design, and

+-------------------------------------+
| header |
+-------------------------------------+
| | |
| left_ | |
| column | main_content |
| | |
| | |
+-------------------------------------+
| footer |
+-------------------------------------+

2. A tri-columnar design

+-------------------------------------+
| header |
+-------------------------------------+
| | | |
| left_ | | right_ |
| column | main_content | column |
| | | |
| | | |
+-------------------------------------+
| footer |
+-------------------------------------+

So I figure that to make this, I'll have:

* 1 header template
* 1 footer template
* 1 bi-columnar table template
* 1 tri-columnar table template

Which also begs the question "How do I embed templates within one another?"

Does any of this make sense, or am I approaching the problem the wrong way?

Thanks for your patience!

-dan



-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will
allow you to extend the highest allowed 128 bit encryption to all your
clients even if they use browsers that are limited to 40 bit encryption.
Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en
_______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general
Re: [Bricolage-General] templates and "media" [ In reply to ]
On Friday, January 17, 2003, at 02:03 PM, D.Kreft wrote:

> Which also begs the question "How do I embed templates within one
> another?"

Best approach is to use Bricolage 1.5.0 and its utility template
feature. This allows you to create Mason components that you can call
arbitrarily as Mason components at burn time.

> Does any of this make sense, or am I approaching the problem the wrong
> way?

I think you're approaching it the wrong way. You should only turn your
Mason components into media files if you want to distribute them to
your final destination web server and have them execute there. To do
that, you'd do this in your templates:

<%text>
<& /header.mhtml &>
</%text>

The affect then is that the <%text> tags get stripped out before the
file is shipped off to your final destination Mason server, where the
enclosed component call would then be executed when the file is
requested. If you wanted to pass arguments to it, you'd have to do
something like this:

<%text> <& /header.mhtml,</%text>
% title => $element->get_data('title'),
</%text> &>

However, I don't think that's what you want. What you want is to have
the Mason component execute at burn time, and write content into the
resulting static files, yes? In that case, use utility templates in
1.5.0.

HTH,

David

--
David Wheeler AIM: dwTheory
david@kineticode.com ICQ: 15726394
Yahoo!: dew7e
Jabber: Theory@jabber.org
Kineticode. Setting knowledge in motion.[sm]



-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will
allow you to extend the highest allowed 128 bit encryption to all your
clients even if they use browsers that are limited to 40 bit encryption.
Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en
_______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general