Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3427640
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:51:42+00:00 2026-05-18T06:51:42+00:00

With both views and panels (via the page manager), you can create a page

  • 0

With both views and panels (via the page manager), you can create a page that accepts arguments like users/%/points.

However, I don’t need any of the other functionality of these modules beyond the creation of that dynamic page URL. I simply want to create a page that will appear when someone is at the url users/%/points. How can I set up a URL like that without using a module like Views or Panels?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:51:43+00:00Added an answer on May 18, 2026 at 6:51 am

    Drupal has a system to create dynamic pages, this is what happens when you view a node or a user. You got a few options, but it all happens in hook_menu.

    function modulename_menu() {
        $items = array();
        $items['users/%user/points'] = array(
            'page callback' => callback, // the function to call
            'page arguments' => array(1), // The argument to pass, 1 = %user, which will be a user object.
             ...
        );
        $items['users/%/points'] = array(...);
        $items['users/points'] = array(...);
    }
    

    In the first example, you utilize Drupal’s load system. Drupal will call user_load on the argument index at 1, if it finds a user, that will be available instead of the actual argument (the user id). If no user is found 404 will be returned.

    In the second example, any argument is allowed, which means that you would get a page if you tried to access user/my-little-pony/points.

    In the third example is used to show that Drupal allow additional args. So if you want to access user/points/pony, you would get the user/points page with additional args which could be used, if your callback function allows it.

    Remember to set some sort of access control as well. You can define custom functions to determine if the user should have access, you use the drupal menu system and require permissions, like access content.

    Ready made code:

    /**
     * Implementation of hook_menu().
     */
    function example_menu() {
      $items = array();
    
      $items['user/%/points'] = array(
        'title' => 'Page title here',
        'description' => 'Description here, mostly used for admin pages',
        'page callback' => 'example_callback',
        'page arguments' => array(1)
        'access arguments' => array('access content'),
      );
      return $items;
    }
    
    example_callback($arg) {
      return t('The arg is @arg', array('@arg' => $arg));
    }
    

    This would need to go into example.module and you would need to create an example.info file. You could change example into whatever module you have created.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to define a method that is available in both my views and
I have two separate views that both show multiple lists of values. Both views
How can i see only VIEWS in SQLite. .tables command list both views as
Query plans are stored in the plan cache for both views and ordinary SQL
I have a little app up that has both CCLayer view and UIView. That
I have view page with both detailview and gridview the grid view should be
I have two view controllers in a tabbar which can both edit data. Therefore,
I have an app that needs backgrounds for both parts of the split view.
I am using sencha to create a carousel which has multiple card panels. Each
When Delphi (2006) goes quantum: I've got something that appears to be both a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.