I wanted to create wildcard menu like text-text-% in drupal 7.

But It works for if the menu is like text-text/% how can I make the above menu format to locate the action.

 $items['pin-code-%'] = array(    
        'title' => 'Country list',
        'description' => 'Country pincode',
        'page callback' => 'country_pincode',
        'access callback' => true,

Wildcard menu items for root level is not supported. Partial match wildcards are not supported either.

You can, however, remap incoming requests to a proper menu router that Drupal supports by implementing hook_url_inbound_alter. Unless there is a strict requirement to use the path pattern you mention, I wouldn't go for this solution because this hook is executed to every request, including normal pages and Ajax requests.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.