Kassetra Stevenson wrote:

> So -- I have the layout done (CHECK!)
> The forms/questionnaires are done (CHECK!)
> The content has been categorized into Topics/Articles (CHECK!)
>
> Now, two questions here (I'm learning, HONEST!)
> 1. I want to pull the articles for each topic into separate pages, so I
> know I need to create a page for each Topic.  Done.  I'm not quite sure
> how to write the php code to pull the Articles into the page, however.
> How do I pull the content for a given topic into a page?

First, are you sure you want a different page for each topic tree? I
generally only use separate pages when I want different functionality,
or different design for a particular part of the site. If you just want
the topic name to show in the URL, there's ways to do that without
multiple pages.

To answer your question, though, for a particular named root topic:

$topic = mgd_get_topic_by_name(0, "Topic for this page");
$articles = mgd_list_topic_articles($topic);

while ($articles && $articles->fetch()) {
   echo $article->title, "<BR>";
}

This is pretty basic, but as my prof (way back when dinosaurs roamed the
earth, and I was at university, ah, days of my youth, yada yada) used
to say, "don't focus on the solution; focus on the problem, get it clear,
and the solution will follow". So let's first talk about what you want
to achieve before we move on to the how of things.

> 2. Ok, now, here's my weird question (and I'm sure someone tried to
> explain it before, but I didn't know then what I know now about midgard,
> so please explain it to me again): I want to change the first letter of
> each article I pull into the page into a graphic.  I can write the php
> code to do so (hopefully) -- but I don't know where exactly to put this
> code.  Do I put it in the article pull code?  Help!

Where you'd ususally say something like &(article.content); you'd now do

<?php
   $car = substr($article->content, 0, 1);
   $cdr = substr($article->content, 1);

   echo "<IMG SRC=/specialcaps/$car.gif>";
?>&(cdr);

> I swear, I have notes for all of my questions.  I can write a nice,
> detailed documentation of how to convert your website into midgard, but
> I have to get my site done first.  :)  (pay the bills and all that
> stuff)

That would be excellent. Don't be shy, now. Helping people work with
Midgard can be a refreshing change of pace next to the usual work of
fixing problems :)

Emile


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

Reply via email to