Greets, Fred!

I did something almost exactly like this on my site.  First, I created a
main style element called "menu":

<p>
<?{ $link = mgd_get_article(14); ?>
<strong><a href="/">&(link.title);</a></strong><br>
&(link.abstract);</p>
<? } ?>

<p>
<? { $link = mgd_get_article(7); ?>
<strong><a href="/programming/7.html" >&(link.title);</a></strong><br>
&(link.abstract);</p>
 <?  } ?>

<p>
<? { $link = mgd_get_article(8); ?>
<strong><a href="/hosting/8.html" >&(link.title);</a></strong><br>
&(link.abstract);</p>
 <?  } ?>

There is probably a programmatic way to determine the page names and article
numbers, but I haven't gotten around to figuring them out yet.  For each
page, I again created a style element called "menu" that when the page is
loaded, over-rides the top level style:

<p>
<?{ $link = mgd_get_article(14); ?>
<strong><a href="/">&(link.title);</a></strong><br>
&(link.abstract);</p>
<? } ?>

<p>
<? { $link = mgd_get_article(7); ?>
<strong>&(link.title);</strong><br>
</p>
 <?  }
$topic = 8;
   $article = mgd_list_topic_articles( $topic, "score");

   while( $article->fetch() ) {
   ?><li><a href="/programming/&(article.id);.html">&(article.title);</a>
</li>

<?}?>
</ul>
<p>
<? { $link = mgd_get_article(8); ?>
<strong><a href="/hosting/8.html" >&(link.title);</a></strong><br>
&(link.abstract);</p>
 <?  } ?>

This reads through all the article titles and places them below the original
topic title.  Finally, on the page itself, I put the following code:

<?php if ($argc == 1) $id = $argv[0];
$article = mgd_get_article($id); ?>
<p class="abstract">
<H2>&(article.abstract);</H2></p>

&(article.content:h);

Which takes the article id and displays the content on the page.  One
noteworthy item here, the pages must be set as dynamic for this particular
script to work.

To get an idea if this is what you are looking for, check out
http://www.internest-pub.com . If that's what you are looking for, E-mail me
and I'll see if I can help you work through it.

Jamie Tomlinson
[EMAIL PROTECTED]

> -----Original Message-----
> From: Fred Hirsch [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 16, 2000 7:49 PM
> To: [EMAIL PROTECTED]
> Subject: [midgard] Accessing Topic IDs
>
>
> Hmmm.. well, the Midgard manual doesn't seem to mention this, so I will
> attempt to ask it here. I have a contents link section for my site
> similar
> to the navilinks section on the test site. I would like to have this
> section dynamically expand topics upon topic selection. As an example:
>
> - Company
> - Products
> - Resources
> - Help
>
> When clicking on Company, I would like the contents to expand to a
> predefined list, i.e:
>
> - Company
>    - Members
>    - News Releases
>    - Legal
>    - Inquiry
> - Products
> - Resources
> - Help
>
> My question is, how do I get the topic ID or perhaps the page URL from
>       http://www.foo.com/company/
> My initial idea was to use an if statement such as
>      if (mgd_is_article_in_topic_tree(14, $id))

>           HAPPY HTML BLOCK
>      }
> This only works for individual articles, not the topic or its subtopics.
> Any good ideas here? I am not looking for a dynamic tree expansion using
> JScript, just something that changes the navilinks on various web pages
> depending on the content section/subsection.
>
> Thanks in advance.
>
> --
> 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]
>


--
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]

Reply via email to