Hi Rene, let's have a look:
> I embeded the code in my home page and tried to create my own menu of the
> web site:
> 
> <?$hostobj=mgd_get_host($midgard->host);
WHat do you need the host object for? 
> $pageid=$midgard->page;
Ok. Pageid is no an integrer say 4.
You then need to do :
$page = mgd_list_pages($pageid);
and change 
> while($pageid){ // $pageid is not an object here ;)
to 
> while($page->fetch()){
> $page=mgd_get_page($pageid);
AH! Delete. 
> ?>
>     <tr>    <BR>&(page.title);</BR> </tr>
>    <?
I often use &(article.title:h); so that a bit html is ok, f.x a <b>
title</b> here
>    $pageid=$page->up;
Ok, subpages as well? Maybe you should look at the function
mgd_walk_pages?
>    }
>    ?>
> I only can get the host title, not the page's. My page's URL is like
> "host/PR". I am a newbie of PHP.  Please help!
No problemo :)
> Is there is code on how to generate menu?
A menu can be som many things. I like to use the topic structure for my
menus but this varies from site to site.

here's a quick snippet (not debugged) for listing the menu recursivley:

function rene_make_menu($id) {
$page = mgd_get_page($id);
?>  <tr>    <BR>&(page.title);</BR> </tr><?
}
$root = <your_page_root>;
$someparam = "";
$maxlevel = 3;

mgd_walk_page_tree(rene_make_menu,$root,$maxlevel,&$someparam,TRUE);

Tarjei

> 
> Thanks a lot.
> 
> Rene
> 
> CONFIDENTIALITY : This e-mail and any attachments are confidential and may
> be privileged. If you are not a named recipient, please notify the sender
> immediately and do not open any attachments hereto, disclose the contents
> of this e-mail or the attachments if any thereto, to another person, use it
> for any purpose or store or copy the information in any medium.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to