Thanks this is a great module. Was struggling to style internal links as buttons using your great module. I realised the span tags needed adding but wanted to use the drupal l function so that links were not hard coded. Eventually I got there with the following:
print l('<span>' .t('Sign Up') .'</span>', 'user/register', array('attributes' => array('title' => t('Create a new user account.'), 'class' => 'button'), 'html' => 'TRUE'));
You might wish to add this to the documentation to speed things up for newbies like myself e.g.
The button style can also be applied to hyperlinks by adding the .button class and a span tag. The span tag allows the sliding doors technique to be applied:
My Button Link
Applying the button style to links using the drupal l function:
print l('<span>' .t('Sign Up') .'</span>', 'user/register', array('attributes' => array('title' => t('Create a new user account.'), 'class' => 'button'), 'html' => 'TRUE'));
Thanks again for a great module, really helped me out.
Comments
Comment #1
skilip CreditAttribution: skilip commentedThe code below allows you to choose a button style formatter for the link module.
Comment #2
asb CreditAttribution: asb commented@skilip: Do I understand this correct: Your snippet is a skeleton for an add-on module and doesn't go into the theme's template.php file, but in something like YOUR_MODULE.module (and thusly requires an .info file and the like)?
Excuse the stupid non-coder question ;)
Comment #3
pmathur01 CreditAttribution: pmathur01 commentedIs it possible to theme links in views to button? Example I have link to [node_link] for view more which will result in a link . Is it possible to make this into a button with this module?
Thanks
Prerna
Comment #4
MBroberg CreditAttribution: MBroberg commentedYes, you have to rewrite the field and include span tags around what you want the button to say. Then write "button" in the class.