Drupal has a print link function that I’m using in my .tpl.php
<?php
print l(t('Announcement'), 'node/30');
?>
l makes it become a link. Does drupal have an equivalent API function to make buttons?
If not, what’s your best suggestion for this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It comes down to what you mean by ‘button’.
If you are talking about an actual form button, then you will want to look at the drupal form API for how to go about making forms.
If you are talking about making something that looks like a button, then I would still be using l(), but pass along something like “class” => “my-fancy-button” to the attributes array, then style the my-fancy-button class with CSS – either simply with a bg colour and some borders, or with a more complicated image background.