[Bese-devel] UCW project and docs for newbies

Marco Baringer mb at bese.it
Fri Jun 17 08:05:36 UTC 2005


Brad Anderson <brad at sankaty.com> writes:

> Answers to the questions I have on this page:
> http://trac.dsource.org/projects/koth/wiki/MultipleContainersSamePage
> would be greatly appreciated.

Q: Can I make the main page (home.lisp) a template? Do TAL templates
   allow for 'container' place-holders? I.e. I'd have a home.tal file
   that laid out all the mark-up and the two containers (header and
   league-home) had their place in the .tal file? Kind of like with
   JSP's you can include one inside another.

A: yes. use the <ucw:render-component tag like this:

   <ucw:render-component component="(header $component)"/>

   When rendering TAL pages the variable $component is bound to the
   current component, so assuming this is home-window's templote and
   you want to render the component in the header slot. look at the
   tabbed-pane component's tal page (ucw/wwwroot/ucw/tabbed-pane.tal).

   the other way to 'merge' tal pages is through the tal:include tag.
   there are some (very small) examples in yaclml/t/inc[123].tal.

Q: Are there good TAL resources/docs out there? I'm looking at the
   ones involving PHP and hoping there's some consistency. I'll admit
   that I have more to read, but wanted to make sure I'm reading the
   right and/or recommended stuff.

A: The Zope stuff is what i started with.

   the only thing i've added to the general TAL style is the
   possibility of embedding lisp code in attributes which allows you
   to do things like:

   <a href="${(source-code-link $component)}">source</a>

   or

   <span class="@{(all-applicable-classes $component)}">
     ...
   </span>

   the syntax for this is documented in yaclml/src/tal/compile.lisp

Q: What's with the mark-up that comes out of UCW? Is that a Marco
   style thing? Why do the tags split to the next line at white-space?
   With variable-length attributes and the like, is this style best?

   dude, you're just smoking the wrong weed...

   just kidding, up until a few months ago tal/yaclml code was printed
   without any kind of whitespace or indentation. this had the
   advantage of making the pages significantly smaller, but near
   impossible to debug. intsead of trying to figure out which tags i
   could add/remove whitespace around without changing the visual
   rendering of the page i opted for something simplier: put the
   indentation whitespace inside the tags themselves.

   you can turn it off by setting *yaclml-indent* to NIL. this setting
   must be made when _compiling_ yaclml/tal code so you may need to
   wipe out the tal generator cache or remove some fasl files for it
   to have effect.

if you have any more specific question i'll be more than happy to
answer.

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen



More information about the bese-devel mailing list