Hi,
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 1/3/01, 4:22:07 PM, <[EMAIL PROTECTED]> wrote regarding
[midgard-user] newbie: using page, topic and articles:
> After reading and following this list for about three or four months i
> decided to use Midgard as our content management system (zope
> or egrail were some of the other possibilities).
Welcome. I am glad you picked us!
> Asgard looked amazingly easy to use....and i got stuck.
> When i set up the host it asked for a root page, which i called
> index.html (wrong?)
Not a all. You are free to choose any name you like. Regardless of the
name however, you call the rootpage by accessing the host url. So if the
host is http://www.weltpolitik.net/ then that is how you access the root
page. Http://www.weltpolitik.net/index.html would not return the
rootpage. (at least not without you taking special actions to make that
so).
> entered some htlm into it and i could call the
> page in my browser. The Midgard manual tells me that pages are
> nodes in the database and symbolise the directory structure of the
> called URL (www.weltpolitik.net/foo/1.html, where foo would be the
> page).
> So i made a new topic (topic) and added an article (article1.html).
> As i was used from Dreamweaver i hoped that i could simply type
> "www.weltpolitik.net/topic/article1.html" ;-)
> After reading the Midgard Manual once again and the FAQ
> (.../using.htm) i edited index.html once again and entered "<?
> $article = mgd_get_article(4); ?>" which didn't show me the article.
> Only after i found the article on the web by Brian Jepson and added
> "&(article.content:h);" the article was displayed.
Can you post the url to that article?
> Ok, so now i can display all articles in the root page. But how is it
> possible to have a link to another article ? Where does the call for
> page x have to be entered?
A possible approach would be to create a page named topic, and mark it as
active.
Active pages get the rest of the url handed as parameters. Calling
http://www.weltpolitik.net/topic/long/url/as/example/1.html would then
automagicaly provide the page with $argc and $argv[] containing the
parametercount and parametervalues. These would be:
$args == 6;
$argv[0] == "long";
$argv[1] == "url";
...
$argv[5] == 1;
note that midgard strips the .html of the last parameter and only passes
the one. This is so that URL are still 'natural' in the eyes of
webcrawlers and the like.
Now you could:
<?
if($argv[0] == long) {
if($list = mgd_list_topic_articles($argv[5])){
while($list->fetch){
?><a href="/article/&(list.id);.html">&(list.name);</a><br>
<?
}
}else { ?>no such article or not enough parameters in url<br><? }
} else { ?>I'm a stupid example. Can't deal for url without "long" in
it<? }
?>
Creating a page named article that then displays the article is left as
exercise for the reader.
> For example: The first page should look like the categories in
> yahoo.
> If i grasp the idea of Midgard every category would resemble a topic
> and subcategories -> subtopics with the stories being articles. The
> pages would then divide the structure of the webside into those
> categories so that it would be possible to call article1 (if it would be
> an overlapping article) once as weltpolitik.net/internet/1.html and
> also in weltpolitik.net/internet/browsers/security/1.html ???
> How many pages do i need? One for every article ?
At least one page to explain what browser-security has to do with
weltpolitik ;-)
I think the example above shows how you would create a page that could be
called to list the contents of many separate subtopics depending on how
the page was called. Creating another page to display the full articles
(or you might get ambitious and stuff it into one page) then saves you a
lot of pages.
> I am sorry to ask such stupid questions but for the first time in five
> years of administering linux systems i am truly at loss :-(
1) those questions are not stupid.
2) I wonder how many years in total you are in administring linux then.
I f*cked my root password on my first install and spent ages to create a
slackware rescue floppy. When I finally booted into rescue mode and
mounted my rootpartition, I had to edit /etc/passwd with.... vi. I would
exchange vi for any editor now, but then I really found the meaning of
being at loss.
> If somebody could show me a good link were i would find an
> introduction on how to build websides with Midgard ??
I suggest you peek at the code for the example site (supposing you
installed it too), the old admin site (same assumption) and asgard. That
will give you a lot of ideas. The example site is very basic, old admin
and asgard are much more complex, but do have some neat tricks. Just
check how little pages asgard really has.
> Might the layered admin by Alan Knowles be a solution ?
Don't know, but I encourage you to try it out. It is just a different
interface to the same software, but the approach is quite different.
Sometimes confusing to me, because I'm still used to admin/asgard
filosofy, but it is certainly worth a try. Worst it will do is give you
some new ideas.
Hope this helps you to get going, looking forward to hear about your
progress.
Armand.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]