views:

90

answers:

2

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?

A: 

Start here: http://api.drupal.org
About forms: http://api.drupal.org/api/group/form_api/6
About writing modules: http://drupal.org/developing/modules

Examples of forms and others here: http://drupal.org/project/examples

Nikit
+5  A: 

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.

Andrew