{NAV_LIST:xx:css_class} returns error...

Use GitHub to post bug reports and error descriptions for phpwcms. Describe your problem detailed!
Locked
cyaneo
Posts: 128
Joined: Sun 6. Feb 2005, 01:23
Contact:

{NAV_LIST:xx:css_class} returns error...

Post by cyaneo »

Hi,

I use {NAV_LIST:1:topnavi} as top navigation and with active subnavi I got the error on XHTML Validation
--------------------------------------------------------------------------
Ich verwende {NAV_LIST:1:topnavi} als topnavi und wenn ein Untermenü "aktiv" ist (bzw. wenn kein Untermenü existiert, dann auch mit "aktivem" Hauptmenü), erhalte ich bei der XHTML Validierung den Fehler

Code: Select all

Line 57, column 4: end tag for "ul" which is not finished

</ul></li>

Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element (e.g. 'ul') which requires a child element (e.g. 'li') that you did not include. Hence the parent element is "not finished", not complete.
The menu from the source:
-------------------------------
das betroffene Menü aus den Sourcecode:

Code: Select all

Line 48 <div id="topnavicontainer"><ul class="topnavi0">
Line 49 <li><a href="firma.htm">Company</a><ul class="topnavi1">
Line 50 <li class="topnaviActive1"><a href="credo.htm">Credo</a><ul class="topnavi2">
Line 51 </ul></li>
Line 52 <li><a href="man-power.htm">Man-Power</a></li>
Line 53 
Line 54 <li><a href="zertifizierung.htm">Zertifizierung</a></li>
Line 55 <li><a href="referenzen.htm">Referenzen</a></li>
Line 56 <li><a href="agb.htm">AGB</a></li>
Line 57 </ul></li>
Line 58 <li><a href="leistungen.htm">Leistungen</a></li>
Line 59 <li><a href="schadensservice.htm">Online Schadens-Service</a></li>
Line 60 <li><a href="news+jobs.htm">News+Jobs</a></li>
Line 61 <li><a href="kontakt.htm">Kontakt</a></li>
Line 62 </ul></div>
Line 63 </div>
The front.func.inc.php:

Code: Select all

// -------------------------------------------------------------

function build_list ($struct, $level, $temp_tree, $act_cat_id, $class='', $depth=0) {
        // this returns the level structure based on given arrays
        // it is special for browsing from root levels
        
        if($class != '') {
                $curClass = ' class="'.$class.$depth.'"';
                $curClassNext = ' class="'.$class.($depth+1).'"';
                $curClassActive = ' class="'.$class.'Active'.$depth.'"';
        } else {
                $curClass = '';
                $curClassNext = '';
                $curClassActive = ' class="listActive"';
        }
        
        $depth++;
        
        $temp_menu = "\n<ul".$curClass.">\n";
        foreach($struct as $key => $value) {
                
                if(isset($_SESSION["frontend_user_in"]) && $_SESSION["frontend_user_in"] && $struct[$key]["acat_regonly"]) {
                        $struct[$key]["acat_regonly"] = 0;
                }
                
                //2005-03-28 Oliver Georgi
                //display also when hidden but within selected tree
                if($struct[$key]["acat_struct"] == $level && $key && (!$struct[$key]["acat_hidden"] || isset($GLOBALS['LEVEL_KEY'][$key])) && !$struct[$key]["acat_regonly"]) {
                        
                        if(!$struct[$key]["acat_redirect"]) {
                                $link = 'index.php?';
                                if($struct[$key]["acat_alias"]) {
                                        $link .= html_specialchars($struct[$key]["acat_alias"]);
                                } else {
                                        $link .= 'id='.$key.',0,0,1,0,0';
                                }
                                $redirect['target'] = '';
                        } else {
                                $redirect = get_redirect_link($struct[$key]["acat_redirect"], ' ', '');
                                $link = $redirect['link'];
                        }
                        
                        if(!empty($temp_tree[$key])) {
                        
                                if($act_cat_id == $key) {
                                        $temp_menu .= "\n<li".$curClassActive.">";
                                } else {
                                        $temp_menu .= "\n<li>";
                                }
                                /*
                                if($act_cat_id == $key) {
                                        $temp_menu .= '<a class="listActive" href="'.$link.'"'.$redirect['target'].'>';
                                        $temp_menu .= html_specialchars($struct[$key]["acat_name"])."</a>";
                                } else {
                                        $temp_menu .= '<a href="'.$link.'">'.html_specialchars($struct[$key]["acat_name"]).'</a>';
                                }
                                */
                                $temp_menu .= '<a href="'.$link.'">'.html_specialchars($struct[$key]["acat_name"]).'</a>';
                                
                                $temp_menu .= build_list ($struct, $key, $temp_tree, $act_cat_id, $class, $depth);
                                $temp_menu .= '</li>';
                                
                        } else {
                                $temp_menu .= "\n<li>".'<a href="'.$link.'"'.$redirect['target'].'>';
                                $temp_menu .= html_specialchars($struct[$key]["acat_name"])."</a></li>\n";
                        }
                }
        }

        $temp_menu = trim($temp_menu);
        return $temp_menu != "<ul".$curClassNext.">" ? $temp_menu."\n</ul>" : '';//$temp_menu != "<ul>"
}

// end ionrock
// -------------------------------------------------------------
Please help me to solve the problem
------------------------------------------
Bitte helft mir, den Fehler zu beheben

Test: http://www.eurorisk.at
Gruss
cyaneo
Zen Cart - The Art of e-Commerce

Wenn jeder dem anderen helfen wollte, wäre allen geholfen.
-------------------------------------------
Ein Problem ist halb gelöst, wenn es klar formuliert ist.
Locked