css - 将 css 属性添加到 menu_local_action Drupal 7

标签 css drupal drupal-7

我尝试向 menu_local_action 链接添加额外的类属性,但没有任何效果。 我怎样才能添加这个额外的类

$items['jobs/maintenance/csv/import'] = array(
 'title' => t('Import CSV backup file'),
  'page callback' => 'drupal_get_form',
  'page arguments' => array('import_csv_form'),  
  'access arguments' => array('maintenance vip_advertiser'),
  '#attributes' => array('class' => 'bt', 'import'), //??
  'file' => 'maintenance.forms.inc',
  'type' => MENU_LOCAL_ACTION,
  'weight' => -3,
);

谢谢!

最佳答案

从 Drupal 7 开始,类属性需要一个数组:

'#attributes' => array('class' => array('bt', 'import')),

关于css - 将 css 属性添加到 menu_local_action Drupal 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24995338/

相关文章:

html - 防止 HTML 内容重叠

javascript - 将 div 设置为固定在相对位置上的位置

javascript - Drupal 7 - 如何将 Javascript 添加到 View

image - 设置文件路径 drupal imce

javascript - 从 JS 到 Drupal 的 URL 编码字符串

mysql - Drupal 7 PDOException : SQLState[42S22], 未知字段

css - :hover in css stylesheet doesn't show when

html - 悬停同一父级的一个 DIV 时影响多个 DIV

php - 更改 Drupal 7 编译的 css 和 js 包括使用 https 而不是 http

Drupal 7 - 将类名附加到菜单 block <ul>