Ken Pooley wrote:
> Emile wrote (pretty well for a sick guy)...
> >So /topicname/ is in fact handled by the root page script? Then yes,
>
> ><(content)> will allways correspond to the content part of your root
>
> >page. What do you want to accomplish? Where do you want to get the
>
> >content from?
>
> I want on the subsequent page to get the articles from the sub topic..so
> first page has topics that are linked...press link go to subtopic page and
> list articles...my idea is that if I can use the existing topics as the
> basis for organization then the content creators can add and subtract sub
> topics without me having to hardwire the subpages, in my head it is like
> using puppet sprites in director...I am working in part off of what I think
> is happening with the "if..then..else" in the article statement in the very
> beginning of the root page...it seems to work and sends an artcle request
> off to the <[article2]> element, superseding the rest of the host's root
> page....the clue from last week from Carlida was to look at the code-init
> and that makes sense but I still need to understand what it is doing a
> little better..that is my guess..am I close?
I think the key thing in your plan is giving content-fillers the ability to
add subtopics to a topic, while driving the whole site from a single root
page, yes?
First, looking at your code, you need to be a bit careful about distinguishing
between &(x.y); (in the html) and $x->y (in the php). Next, I suggest that
you comment your close-curlies ("}") so they are easier to monitor.
It looks like you have: (pseudocode)
if (article) foreach of 5 articles {
print article-title
}
if (article-abstract) {
print abstract
}
which only gets you the abstract on the last article.
But that's a typo-type error.
As far as structure, you seem to want:
If this is just the root page:
print a list of topics with links
else if this is one of the topics
print subtopics if any (don't understand if you want to list articles with
subtopics)
else if this is an article
print article info
Unclear about how deep you want the hierarchy to go -- do you want only one
level of subtopic below the first? Will you allow unlimited hierarchy?
I'm not even sure it matters -- you should be able to "dip" into the topic
tree at any level selected.
Then your uris would be something like:
/ root page
/13.html topic (or subtopic?) 13
/13/22.html topic (or subtopic?) 13, article 22 which should
belong to topic 13
There should be a "mgd_get_topic_by_name" but not in 1.2.5 -- is it in 1.2.6
anyone? (You can also write a function to do this using php calls on the
midgard db.) If you do this, you could use the topic name instead of id in
the url...
If you look at midgard-root.php3 (startup file), you will see that code-init
is called before ROOT (and the dependent page elements).
You can put some code in here to parse the uri to extract topic, article....
Then, your page definition should be a set of conditionals to determine how
you got there.
Alternatively, if you don't want to display news on every page (you have it at
the beginning of the page definition), you could have a subpage below the root
page which was actually the active page doing all this work -- or multiple
subpages, corresponding to different topics, with your content-fillers having
to put their new topics as subtopics to this set.
Was I at all coherent here?
the cat
By the way, it's "Carilda" not "Carlida" -- but I have been called worse.
> -----Original Message-----
> From: Emiliano [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, January 17, 2000 3:51 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [midgard] damn...I thought I was getting close...
>
> Ken Pooley wrote:
>
> > I have a root page, it is active...it lists all of the topics and
> > descriptions for a category...the idea is that the topic name is a link
> > into the topic, there is a <[topic]> (listed further down) that should
> take
> > me into the topic and list all of the articles which are childeren of
> that
> > topic..the link works, it goes to /topicname/ but then it seems to go
> back
> > to the root page for content...it seems like either A) it is not picking
> up
> > the topic condition and going off to the topic subpage or ...well that
> > seems to be it...
>
> So /topicname/ is in fact handled by the root page script? Then yes,
> <(content)> will allways correspond to the content part of your root
> page. What do you want to accomplish? Where do you want to get the
> content
> from?
>
> > also I am having trouble finding a way to pass the
> > variable topic ID into the
> > <?$article = mgd_list_topic_articles(topic.id);
> > ....I think...though I haven't gotten to run that far.....
>
> You have various means. $midgard->uri will hold the full request URI
> (so that would be /topicname/ or /dev/topicname in this case), and
> $argv will hold the path elements that follow the active page
> (so all elements, since it's the root page): $argv[0] will
> be 'topicname', or $argv[0] will be 'dev' and argv[1] 'topicname, etc.
>
> 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]
>
> --
> 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]