Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

Using URL arguments in page callback functions

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:08
    In the previous video, we took an introductory look
  • 0:10
    at Drupal's hook_menu, which allowed us to add paths like /magic
  • 0:16
    and items to Drupal's menu system that we can navigate to and display a page.
  • 0:21
    In this video, what we'd like to do is look at some of the other things
  • 0:24
    that you can do inside of hook_menu.
  • 0:27
    If you remember in our previous example,
  • 0:29
    we created the path at /magic, which calls our callback function
  • 0:33
    and creates the magic page.
  • 0:34
    The user can get to the page by simply navigating to the URL magic.
  • 0:39
    What if, however, we wanted to have a URL that wasn't necessarily fixed in the sense that,

Using URL Arguments in Page Callback Functions


This chapter goes through the process of passing a wildcard variable to a function via an argument from the URL. It creates a MENU_LOCAL_TASK tab on the node which inverts the text to display upside down. It uses a page callback function that is included within a separate file in order to save on how much memory is used.

Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.