If you are asking this question it’s pretty safe to say that you are new to Drupal. After you’ve been dealing with Drupal for a while it’s easy to start thinking everyone knows what you are talking about when you start throwing out terms like “Drupal Modules” and “Drupal Themes”, but the truth of the matter is that to the average Joe on the street this all sounds like gibberish.
Once you’ve created a page for your site you are probably going to want to add a link to that page at some point. If you had a Drupal developer like myself build your site then you probably already have a couple of menus in place already, but what happens if you want to add a new one?
Well, you can call me and have me do it, but in my opinion that would an expensive option especially since Drupal 6 makes it extremely easy to do yourself.
One of the first questions people ask me after I show them how to create a page in Drupal is “So where is the page now?”. It’s a simple question but the real answer is a little bit difficult for laymen to grasp at first. You see Drupal doesn’t create new files when it creates a new page, so the page doesn’t exist in a folder on the server where you could go download it as is true with some other content management systems. Drupal stores the information to create the page that you see by storing the necessary information in several places in the database.
If you have been doing web development for any significant amount of time chances are you know how to build a link by hand using the ‘a href=”link/to/some/page”‘ syntax. That method works fine and can even be used inside of Drupal modules, but it is generally frowned upon by the Drupal community. Using the l() function is the Drupal way of building links programmatically, and though it might take some getting used to, in the end you will find that it saves time.
l() is a function that is available anywhere within a Drupal installation. It accepts three arguments:
Adding a new page to a Drupal website is probably the easiest thing you can do in Drupal, none the less there are a couple of important things to be aware of so I am writing this to help beginners understand.