Jump to content


MenuBuilder


  • You cannot reply to this topic
4 replies to this topic

#1 mmjaeger

    Likes Etomite Forums!

  • Member
  • PipPip
  • 343 posts

Posted 28 August 2004 - 08:41 PM

Hello,

Without the intention of sounding rude, I believe that the MenuBuilder snippet that comes pre-installed with etomite does not provide proper html code, doesn't it. Using just the MenuBuilder?id=0 tag, it produces the following code:

<li><a class='highLight' href='welcome'>Home</a></li><a href='news'>News</a><a href='about'>Über uns</a><a href='tiere'>Tiere</a><a href='Gallerie'>Gallerie</a><a href='guestbook'>Gästebuch</a><a href='Angebot'>Angebot</a><a href='links'>Links</a><a href='Kontakt'>Kontakt</a>
.

The "<ul>" tag is completedly missing and only the startpage link gets a "li" tag. The rest of the links are just lined up one after the other.

Is anybody working on this so it would provide proper code or is anybody willing to help me in getting this done. Am I doing something wrong? I haven't touched the snippet at all?!

Thanks in advance for your help.

#2 JuggoPop

    Likes Etomite Forums!

  • Member
  • PipPip
  • 158 posts

Posted 28 August 2004 - 10:14 PM

I think the reason it's setup that way is because etomite is a developers cms, not an end user cms... meaning some editing required... the current snippet is the basic and you format it how you want when setting up etomite.

I actually have 6 versions of the snippet in my etomite.
one basic with br tags, one with no children, one setup as an unordered list, one for a dropdown quick list, and 2 that run a links list together that I was working on for someone...


Thinking about it now however,... that is a good question, seeing as you have to edit it anyway, why not make it a normal list right from the begining...

#3 mmjaeger

    Likes Etomite Forums!

  • Member
  • PipPip
  • 343 posts

Posted 29 August 2004 - 01:51 PM

JuggoPop, on Aug 28 2004, 11:14 PM, said:

I think the reason it's setup that way is because etomite is a developers cms, not an end user cms... meaning some editing required... the current snippet is the basic and you format it how you want when setting up etomite.

I actually have 6 versions of the snippet in my etomite.
one basic with br tags, one with no children, one setup as an unordered list, one for a dropdown quick list, and 2 that run a links list together that I was working on for someone...
Thinking about it now however,... that is a good question, seeing as you have to edit it anyway, why not make it a normal list right from the begining...

Well, I hope somebody is going to take the time and set it up as a properly formated list. Even it's just the default installation, the code it produces should be correct!

would you mind posting your code that produces a correct formated list?

#4 mmjaeger

    Likes Etomite Forums!

  • Member
  • PipPip
  • 343 posts

Posted 29 August 2004 - 03:08 PM

JuggoPop, on Aug 28 2004, 11:14 PM, said:

I think the reason it's setup that way is because etomite is a developers cms, not an end user cms... meaning some editing required... the current snippet is the basic and you format it how you want when setting up etomite.

I actually have 6 versions of the snippet in my etomite.
one basic with br tags, one with no children, one setup as an unordered list, one for a dropdown quick list, and 2 that run a links list together that I was working on for someone...
Thinking about it now however,... that is a good question, seeing as you have to edit it anyway, why not make it a normal list right from the begining...

I guess, that's the way, isn't it:

if(!isset($id)) {
    $id = $etomite->documentIdentifier; //current document
}

$indentString="";

if(!isset($indent)) {
    $indent = "";
    $indentString .= "";
} else {
    for($in=0; $in<$indent; $in++) {
        $indentString .= "&nbsp;";
    }
    $indentString .= "&raquo;&nbsp;";
}

$children = $etomite->getActiveChildren($id); $menu = ""; $childrenCount = count($children); $active="";
if($children==false) {
    return false;
}
$menu .="<ul>";
for($x=0; $x<$childrenCount; $x++) {
	if($children[$x]['id']==$etomite->documentIdentifier) {
  $active="class='highLight'";
	} else {
  $active="";
	}
	if($children[$x]['id']==$etomite->documentIdentifier || $children[$x]['id']==$etomite->documentObject['parent']) {
  $menu .= "<li><a ".$active." href='[~".$children[$x]['id']."~]'>$indentString".$children[$x]['pagetitle']."</a></li>[[MenuBuilder?id=".$children[$x]['id']."&indent=2]]";	
	} else {
  $menu .= "<li><a href='[~".$children[$x]['id']."~]'>$indentString".$children[$x]['pagetitle']."</a></li>";
	}
}
return $menu."</ul>";

...or do you have a more efficient way to do it?

#5 JuggoPop

    Likes Etomite Forums!

  • Member
  • PipPip
  • 158 posts

Posted 29 August 2004 - 03:58 PM

that's it as far as I cen tell.

then I used Listamatic to tweek it with css.
http://css.maxdesign.com.au/listamatic/





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users