Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I18N Drop down menu styling issue
#1
I am having issues setting classes to my navigation and drop downs. Within the I18N plugin, I know where I can set a class to the <li> but do not want to have the drop down <li> to have that class and that's where I'm running into issues. How can I have a class for the parent and not the child?

Code:
<ul class="horizNav">
        <li class="horizNavTab" ><a href="index.html" class="current">Home</a></li>
        <li class="horizNavTab"> <a href="#" >Services</a>
          <div class="dropBox dropBox_NL">
            <div class="dropBoxIn">
              <div>
                <ul>
                  <li><a href="index.html">Installation & Repairs</a></li>
                  <li><a href="index.html">Maintenance Program</a></li>
                </ul>
              </div>
            </div>
          </div>
        </li></ul>


In the I18N plugin folder, this is what I have in the frontend.class.php. Everything would display great if not for it adding the class to the li in the dropdown


Code:
} else {
        if ($showTitles) {
          $html .= '<li class="horizNav"><a href="' . $href . '" >' . $title . '</a>';
        } else {
          $html .= '<li class="horizNav"><a href="' . $href . '" title="' . htmlspecialchars(html_entity_decode($title, ENT_QUOTES, 'UTF-8')) . '">' . $text . '</a>';
        }
        if (isset($item['children']) && count($item['children']) > 0) {
          $html .= '<div class="dropBox dropBox_NL"><div class="dropBoxIn"><div><ul>' . self::getMenuHTML2($item['children'], $showTitles, $component) . '</div></div></div></ul>';
        }
        $html .= '</li>' . "\n";
      }
    }
    return $html;
  }
Reply
#2
Why do you need these classes anyway?

You can define the look and feel of the li without those classes too:
Code:
.horizNav { /* styles for horizontal bar */ }
.horizNav li { /* styles for horizontal bar item */ }
.horizNav li ul { /* styles for dropdown */ }
.horizNav li ul li { /* styles for dropdown item */ }
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply




Users browsing this thread: 1 Guest(s)