#1 (permalink)  
Alt 15.10.2006, 16:06
Neuer Benutzer
 
Registriert seit: 13.08.2006
Ort: Winterthur CH
Beiträge: 3
Standard Horizontale Navigation ohne Submenues

Hallo zusammen.
Ich habe bin mit Hilfe des Buches Tobias Daeschner eine horizontale Navigation ohne Submenues aufzubauen. Daher wollte ich EUCH fragen ob ihr anhand dieses PHP-Skriptes einen Input geben könnt wie es ohne Subkategorien geht, denn das Buch hilft mir auch nicht mehr weiter.

Mfg
PHP-Code:
<?php
/* -----------------------------------------------------------------------------------------
   $Id: xtc_show_category.inc.php,v 1.1 2004/04/26 20:26:42 fanta2k Exp $

   XT-Commerce - community made shopping
   http://www.xt-commerce.com

   Copyright (c) 2003 XT-Commerce
   -----------------------------------------------------------------------------------------
   based on: 
   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
   (c) 2002-2003 osCommerce(categories.php,v 1.23 2002/11/12); www.oscommerce.com
   (c) 2003     nextcommerce (xtc_show_category.inc.php,v 1.4 2003/08/13); www.nextcommerce.org 

   Released under the GNU General Public License 
   ---------------------------------------------------------------------------------------*/

     
function xtc_show_category($counter) {
    global 
$foo$categories_string$id;


    
// image for first level
    //$img_1='<img src="templates/'.CURRENT_TEMPLATE.'/img/icon_arrow.jpg" alt="" />&nbsp;';
        
$img_1='';

    for (
$a=0$a<$foo[$counter]['level']; $a++) {

      if (
$foo[$counter]['level']=='1') {
      
$categories_string .= "&nbsp;-&nbsp;";
      }

      
$categories_string .= "&nbsp;&nbsp;";

    }
    if (
$foo[$counter]['level']=='') {
    
/* if (strlen($categories_string)=='0') {
    $categories_string .='<table width="100%" border=1><tr><td class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">';
    } else {
    $categories_string .='</td></tr></table><table width="100%" border=1><tr><td class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">';
    } */
        
    
if (strlen($categories_string)=='0') {
    
$categories_string .='<table border="0" cellspacing="0" cellpadding="0"><tr>';
    } else {
    
$categories_string .='';
    }

    
$categories_string .= $img_1;
    
$categories_string .= '';
    } else {
    
$categories_string .= '';
    }

    if ( (
$id) && (in_array($counter$id)) ) {
      
$categories_string .= '<td background="templates/'.CURRENT_TEMPLATE.'/images/bg_navibutton.jpg"><img src="templates/'.CURRENT_TEMPLATE.'/images/x.gif" width="10" height="25"></td><td background="templates/'.CURRENT_TEMPLATE.'/images/bg_navibutton.jpg" class="navi_aktiv"><a class="navi_aktiv" href="';
    } else {
         
$categories_string .= '<td bgcolor="#CCCCCC"><img src="templates/'.CURRENT_TEMPLATE.'/images/x.gif" width="10" height="25"></td><td class="navi_inaktiv "bgcolor="#EBDCC7"><a class="navi_inaktiv" href="';
        }

    if (
$foo[$counter]['parent'] == 0) {
      
$cPath_new 'cPath=' $counter;
    } else {
      
$cPath_new 'cPath=' $foo[$counter]['path'];
    }

    if (
SEARCH_ENGINE_FRIENDLY_URLS == 'true'$cPath_new.='&category='.xtc_cleanName($foo[$counter]['name']);
    
$categories_string .= xtc_href_link(FILENAME_DEFAULT$cPath_new);
    
$categories_string .= '">';

    
// display category name
    
$categories_string .= $foo[$counter]['name'];

    if ( (
$id) && (in_array($counter$id)) ) {
      
$categories_string .= '<td background="templates/'.CURRENT_TEMPLATE.'/images/bg_navibutton.jpg"><img src="templates/'.CURRENT_TEMPLATE.'/images/x.gif" width="10" height="1"></td><td><img src="templates/'.CURRENT_TEMPLATE.'/images/x.gif" width="2" height="1"></td>';
    } else {
      
$categories_string .= '<td bgcolor="#CCCCCC"><img src="templates/'.CURRENT_TEMPLATE.'/images/x.gif" width="10" height="1"></td><td><img src="templates/'.CURRENT_TEMPLATE.'/images/x.gif" width="2" height="1"></td>';
        
        }

    if (
xtc_has_category_subcategories($counter)) {
      
$categories_string .= '';
    }
    if (
$foo[$counter]['level']=='') {
    
$categories_string .= '</a>';
    } else {
    
$categories_string .= '</a>';
    }

    if (
SHOW_COUNTS == 'true') {
      
$products_in_category xtc_count_products_in_category($counter);
      if (
$products_in_category 0) {

      }
    }

    if (
$foo[$counter]['next_id']) {
        
xtc_show_category($foo[$counter]['next_id']);
    } else {
        
$categories_string .= '</tr></table>';
    }
  }

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #2 (permalink)  
Alt 22.07.2008, 22:42
Neuer Benutzer
 
Registriert seit: 10.02.2006
Beiträge: 24
Standard

Hallo,

Hast Du dies irgendwie umsetzen können?

Ich versuche dies auch gerade und würde mich über eine kurze Antwort freuen.


Danke Gruß Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #3 (permalink)  
Alt 23.07.2008, 11:41
Erfahrener Benutzer
 
Registriert seit: 05.04.2006
Beiträge: 684
Standard

so geht das nicht wirklich, am besten du lässt dir die links als listen ausgeben und formatierst die via css schön durch, aber besser wäre noch ein barrierefreies echtes suckerfish menu einzubinden. http://users.tpg.com.au/j_birch/plug...fish/#examples guck dir das mal an....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
horizontale, navigation, submenues

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus



Alle Zeitangaben in WEZ +1. Es ist jetzt 09:30 Uhr.

Copyright © 2011 xt:Commerce GmbH / xt:Commerce International Ltd. - All Rights Reserved

xt:Commerce is a SafeCharge brand