We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    here are a horizontal menu who show a menu like the title
    put the snippet and the code css (bolded important cuestions to work)
    snippet
    // --------------------
    // Snippet: menu children
    // --------------------
    // Version: 1.0
    // based on the snippet of [email protected], thanks.
    // Date: 1-1-2006
    // xyzvisual
    //
    // Use:
    // [[DisplayChildren?id=1&class=cssxx&sep=|]]
    //


    $parent_id = $id;
    $css_class = $class;
    $separator = $sep;

    $children = $etomite->getActiveChildren($parent_id); $menu = ""; $childrenCount = count($children);
    if($children==false) {
    return ’No children to display..’;
    }


    $menu .= "";

    $menu .= "<table height=’20’ width=’100%’ border=’0’ cellspacing=’0’ cellpadding=’0’ ><tr>";

    for($x=0; $x<$childrenCount; $x++) {

    if ($children[$x][’id’]==$modx->documentObject[’id’]){
    $menu .= "<td><div valign=’middle’ align=’center’><a class=’menuac’ href=’[~".$children[$x][’id’]."~]’>".$children[$x][’pagetitle’]."</a></div></td>";
    }else{
    $menu .= "<td><div valign=’middle’ align=’center’><a class=’menu’ href=’[~".$children[$x][’id’]."~]’>".$children[$x][’pagetitle’]."</a></div></td>";
    }

    }

    $menu .= " </tr></table>";
    $menu .= "";

    return $menu;
    and now the csss
    .menu {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #214080;
    text-decoration: none;
    font-weight: bold;
    font-variant: normal;
    display: block;
    line-height : 25px;

    background-color: #FFFFFF;
    border-top: thin solid #214080;
    border-right: thin none #214080;
    border-bottom: thin solid #214080;
    border-left: thin solid #214080;
    }
    .menu:hover {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #214080;
    text-decoration: none;
    font-weight: bold;
    font-variant: normal;
    display: block;
    line-height : 25px;

    background-color: #F0F8FB;
    border-top: thin solid #214080;
    border-right: thin none #214080;
    border-bottom: thin solid #214080;
    border-left: thin solid #214080;
    }
    .menuac {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #FFFFFF;
    text-decoration: none;
    font-weight: bold;
    font-variant: normal;
    display: block;
    line-height : 25px;

    background-color: #214080;
    border-top: thin solid #214080;
    border-right: thin none #214080;
    border-bottom: thin solid #214080;
    border-left: thin solid #214080;
    }
    byby
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
      • 12021
      • 3 Posts
      hi xyzvisual

      I use this snippet at my page. thank you smiley

      I would like to put seperators( like [::] ) between the links, see Pic1
      http://thingahennash.th.funpic.de/somepics/Pic1.gif

      So i changed the snippet e bit.

      At different active links, there will be some of the seperators hidden, for better understanding i numbered the seperators,
      see Pic2 - 4. Bold Links are the active one.
      http://thingahennash.th.funpic.de/somepics/Pic2.gif
      http://thingahennash.th.funpic.de/somepics/Pic3.gif
      http://thingahennash.th.funpic.de/somepics/Pic4.gif

      changed snippet code:
      // --------------------
      // Snippet: menu children
      // --------------------
      // Version: 1.0
      // based on the snippet of [email protected], thanks.
      // Date: 1-1-2006
      // xyzvisual
      //
      // Use:
      // [[DisplayChildren?id=1&class=cssxx&sep=|]]
      //
      
      
      $parent_id = $id;
      $css_class = $class;
      $separator = $sep;
      
      $children = $etomite->getActiveChildren($parent_id); $menu = ""; $childrenCount = count($children);
      if($children==false) {
          return 'No children to display..';
      }
      
      
      $menu .= "";
      
      $menu .= "<table height='20' border='0' cellspacing='0' cellpadding='0' ><tr>";
      
      for($x=0; $x<$childrenCount; $x++) {
      
         if ($children[$x]['id']==$modx->documentObject['id']){
            $menu .= "<td><div class='Stil1' valign='middle' align='center'>[1] <a class='menuac' href='[~".$children[$x]['id']."~]'>".$children[$x]['pagetitle']. "</a> </div></td>";
         }else{
                      $menu .= "<td><div class='Stil1' valign='middle' align='center'> [3] <a class='menu' href='[~".$children[$x]['id']."~]'>".$children[$x]['pagetitle']."</a> [4]</div></td>";
         }
      
      }
      
      $menu .= " </tr></table> ";
      $menu .= " ";
      
      return $menu;


      Is it possible to change this snippet for my use?

      thanks for any suggestion
        • 32982
        • 674 Posts
        test it
        // --------------------
        // Snippet: menu children
        // --------------------
        // Version: 1.0
        // based on the snippet of [email protected], thanks.
        // Date: 1-1-2006
        // xyzvisual
        //
        // Use:
        // [[DisplayChildren?id=1&class=cssxx&sep=|]]
        //


        $parent_id = $id;
        $css_class = $class;
        $separator = $sep;

        $children = $etomite->getActiveChildren($parent_id); $menu = ""; $childrenCount = count($children);
        if($children==false) {
        return ’No children to display..’;
        }


        $menu .= "";

        $menu .= "<table height=’20’ border=’0’ cellspacing=’0’ cellpadding=’0’ ><tr>";

        for($x=0; $x<$childrenCount; $x++) {
        if ($x==$childrenCount-1){$menu .= "<td><div class=’Stil1’ valign=’middle’ align=’center’>[1] <a class=’menuac’ href=’[~".$children[$x][’id’]."~]’>".$children[$x][’pagetitle’]. "</a>[1] </div></td>";}else{
        if ($children[$x][’id’]==$modx->documentObject[’id’]){
        $menu .= "<td><div class=’Stil1’ valign=’middle’ align=’center’>[1] <a class=’menuac’ href=’[~".$children[$x][’id’]."~]’>".$children[$x][’pagetitle’]. "</a></div></td>";
        }else{
        $menu .= "<td><div class=’Stil1’ valign=’middle’ align=’center’>[1] <a class=’menu’ href=’[~".$children[$x][’id’]."~]’>".$children[$x][’pagetitle’]."</a></div></td>";
        }}

        }

        $menu .= " </tr></table> ";
        $menu .= " ";

        return $menu;
          Jabiertxof (formerly XYZVISUAL)
          My bussines: http://marker.es
          https://www.youtube.com/user/jabiertxof/videos
          • 12021
          • 3 Posts
          grin
          Hi xyzvisual

          it works great! like my gusto.

          thanks for your fast answer
            • 12021
            • 3 Posts
            sorry

            There is still another thing.
            The active link, example Fitness ist bold, but always the last one too.
            http://thingahennash.th.funpic.de/somepics/Pic5.gif
            can’t find any solution in the snippet code, think the classes meuac and menu are right.

            thx for help
              • 32982
              • 674 Posts
              test it
              // --------------------
              // Snippet: menu children
              // --------------------
              // Version: 1.0
              // based on the snippet of [email protected], thanks.
              // Date: 1-1-2006
              // xyzvisual
              //
              // Use:
              // [[DisplayChildren?id=1&class=cssxx&sep=|]]
              //


              $parent_id = $id;
              $css_class = $class;
              $separator = $sep;

              $children = $etomite->getActiveChildren($parent_id); $menu = ""; $childrenCount = count($children);
              if($children==false) {
              return ’No children to display..’;
              }


              $menu .= "";

              $menu .= "<table height=’20’ border=’0’ cellspacing=’0’ cellpadding=’0’ ><tr>";

              for($x=0; $x<$childrenCount; $x++) {
              if ($children[$x][’id’]==$modx->documentObject[’id’]){
              if ($x==$childrenCount-1){$menu .= "<td><div class=’Stil1’ valign=’middle’ align=’center’>[1] <a class=’menuac’ href=’[~".$children[$x][’id’]."~]’>".$children[$x][’pagetitle’]. "</a>[1] </div></td>";}else{
              $menu .= "<td><div class=’Stil1’ valign=’middle’ align=’center’>[1] <a class=’menuac’ href=’[~".$children[$x][’id’]."~]’>".$children[$x][’pagetitle’]. "</a></div></td>";}
              }else{ if ($x==$childrenCount-1){$menu .= "<td><div class=’Stil1’ valign=’middle’ align=’center’>[1] <a class=’menu’ href=’[~".$children[$x][’id’]."~]’>".$children[$x][’pagetitle’]. "</a>[1] </div></td>";}else{

              $menu .= "<td><div class=’Stil1’ valign=’middle’ align=’center’>[1] <a class=’menu’ href=’[~".$children[$x][’id’]."~]’>".$children[$x][’pagetitle’]."</a></div></td>";}
              }

              }

              $menu .= " </tr></table> ";
              $menu .= " ";

              return $menu;
                Jabiertxof (formerly XYZVISUAL)
                My bussines: http://marker.es
                https://www.youtube.com/user/jabiertxof/videos