Hello,

I made some improvements to these 2 fonctions. See attached patches (I'm not a patch expert, tried to made them with netbeans on windows, not sure it's ok, I'm allergic to command line and it seems the only viable way to make patches so...). But it's very small patches, easy to apply

The first one in twitter_bootstrap.inc line 134
$output .= l($variables['label']['title'], $variables['label']['href'], $variables['label']);

Don't know why you put $variables['label'] as link options, I think it's a typo, so I corrected it to
$output .= l($variables['label']['title'], $variables['label']['href'], $variables['options']);

The second one in template.php around around line 150 you have

    // Build list
    $variables['secondary_nav'] = theme('twitter_bootstrap_btn_dropdown', array(
      'links' => $variables['secondary_menu'],
      'label' => $secondary_menu['title'],
      'type' => 'success',
      'attributes' => array(
        'id' => 'user-menu',
        'class' => array('pull-right'),
      ),
      'heading' => array(
        'text' => t('Secondary menu'),
        'level' => 'h2',
        'class' => array('element-invisible'),
      ),
    ));

In drupal 7 the attributes array needs to be in an option array. And I added html => true too to make it more flexible (for example I would like to add the user glyphicon before the User menu text in the secondary button, but couldn't because it didn't accept html tags). Here so I changed it like that

    $variables['secondary_nav'] = theme('twitter_bootstrap_btn_dropdown', array(
      'links' => $variables['secondary_menu'],
      'label' => $secondary_menu['title'],
      'type' => 'success',
      'options' => array(
        'attributes => array(
          'id' => 'user-menu',
          'class' => array('pull-right'),
        ),
        'html' => true,
      ),
      'heading' => array(
        'text' => t('Secondary menu'),
        'level' => 'h2',
        'class' => array('element-invisible'),
      ),
    ));

Fell free to review and commit it.

Regards,

Alex

CommentFileSizeAuthor
template.php_.patch420 byteszmove
twitter_bootstrap.patch414 byteszmove

Comments

zmove’s picture

I miss a ' after the attributes key to correctly close it. But I cant edit my first post.

zmove’s picture

Status: Needs review » Needs work

After some try, it needs more work. I think I put the finger on a actual limitation, but there are a lot of place where it's called like that, so it would require more changes than expected.

gagarine’s picture

Thanks for your work!
Patch like that are useless, to create a patch please read: http://drupal.org/node/707484. Git has a built in gui than you can run with "git gui" command. Anyway, bash CLI is exactly like programming but one line at the time.

andregriffin’s picture

Project: Twitter's Bootstrap » Bootstrap Framework
andregriffin’s picture

Project: Bootstrap Framework » Twitter's Bootstrap
natted’s picture

Project: Twitter's Bootstrap » Bootstrap
markhalliwell’s picture

Status: Needs work » Closed (won't fix)

This is a legacy issue from the old twitter_bootstrap project. It no longer applies to this project.