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
| Comment | File | Size | Author |
|---|---|---|---|
| template.php_.patch | 420 bytes | zmove | |
| twitter_bootstrap.patch | 414 bytes | zmove |
Comments
Comment #1
zmove commentedI miss a ' after the attributes key to correctly close it. But I cant edit my first post.
Comment #2
zmove commentedAfter 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.
Comment #3
gagarine commentedThanks 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.
Comment #4
andregriffin commentedComment #5
andregriffin commentedComment #6
natted commentedComment #7
markhalliwellThis is a legacy issue from the old twitter_bootstrap project. It no longer applies to this project.