-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

- --On 11.06.2002 13:50:03 -0400 [EMAIL PROTECTED] wrote:

> I wonder whether it is possible to embed a style for a content. For
> instance, can I create the content layout as a table and fill in with
> text or image later when I create the page? How?

Basically, what Tarjei said is the right idea. You just have to keep in
mind that both style and page-code can call _both_ style and page
elements. It uses the same syntax and therefore it stays transparent.

Another common solution is something like this:

HTML-BODY Style Element:

 ---
<h3><[page-title]></h3>
<[style-separator]>
<adress><[page-location]></adress>

<[style-table-header]>
<(content)>
<[style-table-footer]>
 ---

The style-* elements come from the style tree, whereas the page-*
elements come from the page tree. This is a good way to keep style and
code in two separate points.

Further on: If you have two different types of contents to display, let's
say regular articles and a newsticker overview, you can use some schema
like this:

In the page content do a

 ---
if ($article)
{
  $view = mgd_get_article($articleid)
  ?> <[style-show-article]> <?
} else if ($newsticker) 
{
  $viewlist = mgd_list_topic_articles($newtopicid)
  ?> <[style-newsticker-begin]> <?
  while ($viewlist->fetch())
  {
    $view = mgd_get_article($viewlist->id);
    ?> <[style-newsticker-element]> <?
  }
  ?> <[style-newsticker-end]> <?
}
 ---

Where all elements called here reside in the style tree and contain only
output logic. Mostly, they will look like this:

 ---
<h3>&(view.title);</h3>
<p class="abstract">&(view.abstract);</p>
<div class="content">&(view.content);</div>
 ---

Note that the defined global variables will stay in scope when you enter
the style element.


Live long and prosper!
Torben Nehmer

- --
Torben Nehmer, Munich, Germany
http://www.nathan-syntronics.de, mailto:[EMAIL PROTECTED]
PGP Public Key ID on wwwkeys.(de.)pgp.net: 0x7E9DE456
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9BwY4JPh4Kn6d5FYRAtL7AKDNjq+8vp6UECqFd3nYN2Mic7dI1ACgjFkE
Wyo5rY4gfWPs1L1sOptchMY=
=KlMK
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to