The way that works (unless I've totally misunderstood something) is
that master.kid replaces certain tags in welcome.kid according to
Named Template Functions or Match Templates. If it were the other way
around, that is welcome.kid replaced snippets of master.kid, I would
be in good shape.
I really do not want to have multiple copies of my `main' container
floating around. I suppose if I was on linux, I could just make a
symlink that pointed to the master container. But my `development'
machine has windows XP on it, so that isn't an option, even though I
will push this to linux once I'm finished.
Someone had mentioned using AJAX to dynamically replace the contents
of the `information' div, but if I am going to do that, I might as
well just use ${variable_replacement}.
I have another trick up my sleeve. I'm thinking of creating a
master.kid which is the `container'. It will extend helper.kid.
helper.kid will contain code like this ->
<!--
This code snippet will show the quote of the week.
-->
<span py:def="show_qotw()">
<? qotw = somemodule.get_gotw() ?>
The quote of the week is: "${qotw}"
</span>
Then master.kid will contain code like this ->
<span py:if="current_page == 'qotw'">
${show_qotw()}
</span>
Hmm. I think this will work. I'll reply to the list once I've failed
or succeeded.
Thanks for being a bouncing board for ideas!
jw
On 10/24/05, Swaroop C H <[EMAIL PROTECTED]> wrote:
> Isn't that how the master.kid and welcome.kid templates generated by
> `tg-admin quickstart` work?
>
> You can edit master.kid for your overall design/HTML, and then make copies
> of welcome.kid and edit them for your individual pages (qotw, potw, ...)
>
>
> Hope this helps,
> --
> Swaroop C H
> www.swaroopch.info
>
>
> On 10/25/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > First, I realize I should probably use the kid mailing list for this
> > question. However, I'm sure that at least one other turbogears user
> > will benefit from this information (or at least it's a good enough
> > excuse ;))
> >
> > I am designing a website that has a handful of different `locations'.
> > For instance, the following URLS will probably be used:
> >
> > http://mysite.com/members
> > http://mysite.com/qotw
> > http://mysite.com/potw
> >
> > Now, whenever a user visits one of the links above, from the `main'
> > page, the only thing that I want to change is an `information' div -
> > <div id="information"/>.
> >
> > This information div will contain either member information, quote of
> > the week (qotw) or picture of the week (potw). However, *everything*
> > else around the `information' div remains the same.
> >
> > I examined using py:match, but its usage seems to be more appropriate
> > for changing "headers" and "footers". For instance, you're main
> > document extends some helper document that provides new headers and
> > footers.
> >
> > However, my usage is perpendicular to the `header' and `footers' usage.
> > Instead of having a `main' document that has bits and pieces to
> > replace, I want to have a small `auxillary' document that replaces the
> > `information' div in the main document. Can anyone give me an idea on
> > how to do this. It seems to be simple, but I can't quite grok it. (I
> > hope I'm clear on what I'm attempting to do!)
> >
> > Thanks!
> > jw
> >
> >
>