Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Menu Layout
#1
Hello!

I have a question. I want to style my menu like this:
http://poetzsch-sirch.de/main/index.php

I have rebuilt the template with div's, but now I am wondering how to insert that |.

Can anyone help me?

Thanks,
Martin
Reply
#2
If you constructed your menu basing on divs (every button is a stand alone div) then just add a left/right border to the div, or create a margin between divs, so a background color behind those divs will work as a |

ps. you should create navigation menu basing on lists, not divs.
Addons: blue business theme, Online Visitors, Notepad
Reply
#3
yojoe Wrote:If you constructed your menu basing on divs (every button is a stand alone div) then just add a left/right border to the div, or create a margin between divs, so a background color behind those divs will work as a |

ps. you should create navigation menu basing on lists, not divs.


I have done it with lists. I created an <ul> and inserted the php-code:
<?php get_navigation(return_page_slug()); ?>

But how to solve the Problem with div's?


Thanks,
Martin
Reply
#4
Can no one help?
Reply
#5
Help with what ?
I answered you how to solve your problem with divs
Quote:...add a left/right border to the div, or create a margin between divs...

Or is there something I didn't understand ?
Addons: blue business theme, Online Visitors, Notepad
Reply
#6
I have done it with lists! I dont use divs for the menu, as you advised me.

Thanks,
Martin
Reply
#7
I have a sample solution for the child menu!
Only replacement function!
Code:
function get_navigation($currentpage) {
    $menu = '';
    $path = GSDATAPAGESPATH;
    $dir_handle = opendir($path) or die("Unable to open $path");
    $filenames = array();
    while ($filename = readdir($dir_handle)) {
        $filenames[] = $filename;
    }    
    $count="0";
    $pagesArray = array();
    if (count($filenames) != 0) {
        foreach ($filenames as $file) {
            if ($file == "." || $file == ".." || is_dir($path . $file) || $file == ".htaccess"  ) {
            } else {
                $data = getXML($path . $file);
                if ($data->private != 'Y') {
                    $pagesArray[$count]['menuStatus'] = $data->menuStatus;
                    if ($data->menuStatus == 'Y') {
                        $menuNum = $menuNum + 1;
                    }
                    $pagesArray[$count]['menuOrder'] = $data->menuOrder;
                    $pagesArray[$count]['menu'] = strip_decode($data->menu);
                    $pagesArray[$count]['url'] = $data->url;
                    $pagesArray[$count]['title'] = strip_decode($data->title);
                    $pagesArray[$count]['parent'] = $data->parent;
                    $count++;
                }
            }
        }
    }    
    $pagesSorted = subval_sort($pagesArray,'menuOrder');
    $subpagesSorted = subval_sort($pagesArray,'title');    
    if (count($pagesSorted) != 0) {
        $menu .= '<ul class="sf-menu">';
        $menu .= "\n";
        foreach ($pagesSorted as $page) {            
            if ($page['menuStatus'] == 'Y') {
                if ($page['menu'] == '') { $page['menu'] = $page['title']; }
                if ($page['title'] == '') { $page['title'] = $page['menu']; }                                                                
                $menuNumL = $menuNumL + 1;                
                if ($menuNumL == 1) {
                    $li = 'li class="first"';                        
                } else {
                    if ($menuNumL != $menuNum) {
                        $li = 'li';
                    } else {    
                        $li = 'li class="last"';
                        $menuNumL = 0;
                    }                    
                }                
                $url_nav = $page['url'];                
                if ("$currentpage" == "$url_nav") {
                    $menu .= '  <'.$li.'>';
                    $menu .= "\n";
                    $menu .= '    <a href="'. find_url($page['url'],$page['parent']) . '" class="current"><span class="span-main">'.$page['menu'].'</span></a>';
                    $menu .= "\n";
                } else {
                    $menu .= '  <'.$li.'>';
                    $menu .= "\n";
                    $menu .= '    <a href="'. find_url($page['url'],$page['parent']) . '" class="main"><span class="span-main">'.$page['menu'].'</span></a>';
                    $menu .= "\n";                            
                }                
                foreach ($pagesSorted as $subpage) {
                    $pageRif = $subpage['parent'];
                    if ("$pageRif" == "$url_nav") {
                        $pageNum = $pageNum + 1;
                    }
                }
                if ($pageNum != 0) {
                    $menu .= "      <ul>\n";
                    foreach ($pagesSorted as $subpage) {                        
                        $SubRif = $subpage['parent'];
                        if ($subpage['menu'] == '') { $subpage['menu'] = $subpage['title']; }
                        if ($subpage['title'] == '') { $subpage['title'] = $subpage['menu']; }                
                        if ("$SubRif" == "$url_nav") {                            
                            $liNum = $liNum + 1;
                            if ($liNum != $pageNum) {
                                $menu .= '        <li><a href="'. find_url($subpage['url'],$subpage['parent']) . '">'.$subpage['menu'].'</a></li>';
                                $menu .= "\n";
                            } else {
                                $menu .= '        <li class="last"><a href="'. find_url($subpage['url'],$subpage['parent']) . '">'.$subpage['menu'].'</a></li>';
                                $menu .= "\n";
                                $liNum = 0;
                            }
                        }                    
                    }
                    $menu .= "      </ul>\n";
                    $menu .= "  </li>\n";
                } else {
                $menu .= "  </li>\n";
                }
                $pageNum = 0;                
            }
        }
    }
    $menu .= "</ul>\n";
    $menuNum = 0;    
    closedir($dir_handle);
    echo exec_filter('menuitems',$menu);
}


update our ul > li tag system.

if you have a few problem send me our html menu code. I can adjust position tag's.
sorry my english!
greating's
Reply
#8
nitramf Wrote:I have done it with lists! I dont use divs for the menu, as you advised me.

Thanks,
Martin

why not give a right or left border to LI? or a margin, like suggested?
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#9
Connie Wrote:
nitramf Wrote:I have done it with lists! I dont use divs for the menu, as you advised me.

Thanks,
Martin

why not give a right or left border to LI? or a margin, like suggested?

Normally the style of the menu is the default css file.

the example I posted refers to a complex type of menu!
Usually the menu menufish.js are much easier to manage:
Code:
<ul>
  <li><a href="#">link</a>
    <ul>
      <li><a href="#">link</a></li>
      <li><a href="#">link</a></li>
    </ul>
  </li>
</ul>

http://www.cagayandeorodreamhomes.com/te...htroom/03/
This is a example complex menù

I adapted the function for this type of menu where, in addition to the current page, there are classes daa manage (the fist and the last menu)

I remind you that if you have a special menu for which to create the appropriate function, you can send the part of html code on the menu only.

Sincerely
Reply
#10
If you have multiple themes for same site is not replace the function of the original menu. Be sufficient to integrate the function in the function.php file and rename the it from get_navigation ($ CurrentPage) to get_nametheme_navigation ($ CurrentPage)
Reply
#11
i really need this for my Web design . thanks
Reply
#12
joel14santos5 Wrote:i really need this for my Web design . thanks

I saw your site but I did not find any sub page in your menu.


This function for the no complex child menu (only current class end list child)

Code:
function get_custom_navigation($currentpage) {
    $menu = '';
    $path = GSDATAPAGESPATH;
    $dir_handle = opendir($path) or die("Unable to open $path");
    $filenames = array();
    while ($filename = readdir($dir_handle)) {
        $filenames[] = $filename;
    }    
    $count="0";
    $pagesArray = array();
    if (count($filenames) != 0) {
        foreach ($filenames as $file) {
            if ($file == "." || $file == ".." || is_dir($path . $file) || $file == ".htaccess"  ) {
            } else {
                $data = getXML($path . $file);
                if ($data->private != 'Y') {
                    $pagesArray[$count]['menuStatus'] = $data->menuStatus;
                    $pagesArray[$count]['menuOrder'] = $data->menuOrder;
                    $pagesArray[$count]['menu'] = strip_decode($data->menu);
                    $pagesArray[$count]['url'] = $data->url;
                    $pagesArray[$count]['title'] = strip_decode($data->title);
                    $pagesArray[$count]['parent'] = $data->parent;
                    $count++;
                }        
            }
        }
    }    
    $pagesSorted = subval_sort($pagesArray,'menuOrder');
    $subpagesSorted = subval_sort($pagesArray,'title');
    if (count($pagesSorted) != 0) {
        foreach ($pagesSorted as $page) {
            $sel = '';
            $classes = '';
            $url_nav = $page['url'];
            
            if ($page['menuStatus'] == 'Y') {
                if ($page['menu'] == '') { $page['menu'] = $page['title']; }
                if ($page['title'] == '') { $page['title'] = $page['menu']; }
                if ("$currentpage" == "$url_nav") {
                $menu .= '<li class="current"><a href="'. find_url($page['url'],$page['parent']) . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a>';
                } else {
                $menu .= '<li><a href="'. find_url($page['url'],$page['parent']) . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a>';
                }                
                foreach ($subpagesSorted as $subpage) {
                    $pageRif = $subpage['parent'];
                    if ("$pageRif" == "$url_nav") {
                        $pageNum = $pageNum + 1;
                    }            
                }
                if ($pageNum != 0) {
                    $menu .= '<ul>';
                    foreach ($subpagesSorted as $subpage) {
                        $subPageRif = $subpage['parent'];
                        if ($subpage['menu'] == '') { $subpage['menu'] = $subpage['title']; }
                        if ($subpage['title'] == '') { $subpage['title'] = $subpage['menu']; }                
                        if ("$subPageRif" == "$url_nav") {
                            $menu .= '<li><a href="'. find_url($subpage['url'],$subpage['parent']) . '" title="'. strip_quotes($subpage['title']) .'">'.$subpage['menu'].'</a></li>';
                        }                    
                    }
                    $menu .= '</ul>';
                    $menu .= '</li>';        
                } else {
                $menu .= '</li>';
                }
                $pageNum = 0;    
            }
        }        
    }    
    closedir($dir_handle);
    echo exec_filter('menuitems',$menu);
}

Example html menu child code
Code:
<ul>
  <li class="current"><a href="#">link</a>
    <ul>
      <li><a href="#">link</a></li>
      <li><a href="#">link</a></li>
    </ul>
  </li>
<li><a href="#">link</a>
</ul>
Copy end paste it in the funcion theme file or in the theme function in admin/inc/

Replace get_navigation($currentpage) >> get_custom_navigation($currentpage) in the theme template file.

by gsit (always disposal)

a new admin interface in working:
Reply




Users browsing this thread: 1 Guest(s)