create a host (or you can alter the demo site).
create a root page that has text & graphics for your opening page.
Create the Style & its elements (via 'Layout Administration/
Create new toplevel style'). When created, open the style and create
the following elements (empty for the moment):
- head
- layout
- leftmenu
- lib
- ROOT
- topmenu
now fill the style elements:
** head:
<head>
<title><(title>)</title>
</head>
** layout:
<body bgcolor="#FFFFFF" text="#000000" link="#330000" alink="#C0C0C0"
vlink="#330000">
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tr><td colspan=3 align=left valign=top
width="100%"><(topmenu)></td></tr>
<tr><td width="20%" bgcolor="#A0A0A0" align="left"
valign="top"><(leftmenu)></td>
<td width="2%"> </td>
<td width="78%" align=left valign=top><(content)></td></tr>
</table>
</body>
** leftmenu
<?php
topic_menu(14); /* 14 is a fake root topic, we'll get back to change it
later */
?>
<!-- add logo & blurb -->
** lib
<?php
function topic_menu($root)
{
if ($t = mgd_list_topics($root))
{
echo "<ul>\n";
while ($t->fetch())
{
?> <li><a href="/topic/&(t.id);.html">&(t.name);</a> <?php
topic_menu($t->id);
echo "</li>\n";
}
echo "</ul>\n";
}
} ?>
** ROOT
<html>
<(lib)>
<[head]>
<[layout]>
</html>
** topmenu
<!-- add logo and navigation stuff maybe? -->
Now go to 'Content Administration' and create a new toplevel topic. Note
down the number and go back to change style element 'leftmenu' and
change
'14' into the new number.
Now we need a page to actually show the topics & articles:
Create a subpage from your root page (Via 'Content Administration',
select your host, select your root page, click 'create subpage').
Call this page 'topic', set it to 'active' and give it the following
content:
<?php
$topic = mgd_get_topic($argv[0]);
if (! $topic) { echo "Topic $argv[0] does not exist"; }
else
{
?>
<h3>&(topic.name);</h3>
<?php
if ($a = mgd_list_topic_articles($argv[0]))
{
echo "<dl>";
while ($a->fetch())
{
?>
<dt><a href="/article/&(a.id);.html">&(a.title);</a></dt>
<dd>&(a.abstract:t);</dt>
<?php
}
echo "</dl>";
}
else
{
echo "No articles";
}
}
?>
Create a subpage from your root page (Via 'Content Administration',
select your host, select your root page, click 'create subpage').
Call this page 'article', set it to 'active', and give it the
following content:
<?php
if ($argc == 1 && ($article = mgd_get_article($argv[0])))
{
$topic = mgd_get_topic($article->topic);
?>
<h1>&(topic.name); : &(article.title);</h1>
<p>&(article.abstract:t);</p>
&(article.content:F);
<?php
}
?>
All done. Any article or topic you now add under the root topic you
defined earlier will automagically show up in the menu on the
left, and any article you click on will be displayed.
Have fun,
Emile
--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org
To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]