简体   繁体   English

如何在菜单的li-Tag中添加类?

[英]How to add a class in li-Tag of a menu?

I seem to be blind, stupid or both but I can't add own classes to li-items of a menu. 我似乎是盲目的,愚蠢的或两者兼而有之,但是我不能将自己的类添加到菜单的限制项中。 Here are multiple tries: 这里有多次尝试:

<?php
  $options = array(
    'items' => 'menu1', //menu to be displayed
    'class' => 'own-class-test-1',
    'css' => array(
      'class' => 'own-class-test-2',
    ),
    'active' => 'own-active-test-2',
    'attributes' => array(
      'id' => 'ipsTest',
      'class' => 'nav nav-pills pull-right'
    )
  );
  echo ipSlot('menu', $options); ?>

Can anybody help me with this? 有人可以帮我吗? I am only able to change the preset like active-class. 我只能像活动课程一样更改预设。 Adding classes to the ul works without problems. 将类添加到ul可以正常工作。

Thank you & cheers, Thomas 谢谢你,Thomas

I've check the code. 我已经检查了代码。 Currently you can modify <li> only through variable defined here - https://www.impresspages.org/docs/navigation 当前,您只能通过此处定义的变量来修改<li> -https: //www.impresspages.org/docs/navigation

There's no "default" things to add extra class for all <li> . 没有为所有<li>添加额外类的“默认”东西。 However, if it selects every tag then what's the point adding it? 但是,如果它选择了每个标签,那么添加标签有什么意义呢? Add required styles directly through CSS. 直接通过CSS添加所需的样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM