drupal-6


Drupal 6: Adding sub menu items on a menu item?


I have a hook:
function node_field_link_menu()
{
$items['order_food'] = array(
'title' => 'Products',
'page callback' => 'node_field_link_products_page',
'access callback' => TRUE,
'menu_name' => 'primary-links',
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
This gives me my menu item and I'm happy with it. The problem is, I want items UNDER this menu item, so I end up with:
- Products
- Product 1
- Product 2
- Product 3
- Product 4
I read that you can use "plid", but the problem is, in this context, I don't know what the PLID is, because I just created the parent. So I can't do this:
function node_field_link_menu()
{
$items['order_food/procuct1'] = array(
'title' => 'Product 1',
'page callback' => 'node_field_link_products_page1',
'access callback' => TRUE,
'menu_name' => 'primary-links',
'type' => MENU_NORMAL_ITEM,
'plid' => XXX?,
);
return $items;
}
So how can I add another menu item below a menu item I created in Drupal 6?
What you did should work without the 'plid'. Drupal recognizes the path pattern and does the job for you. Meaning, if you have a path of 'order_food' and a path of 'order_food/product1', product1 will be the child of 'order_food'.
All you need to do after creating the menu is to clear Drupal's cache.
Just tried it on a new Drupal 6 instance, cleared the cache and I see it working:
$items['order_food'] = array(
'title' => 'Product',
'page callback' => 'node_field_link_products_page',
'access callback' => TRUE,
'menu_name' => 'primary-links',
'type' => MENU_NORMAL_ITEM,
);
$items['order_food/product1'] = array(
'title' => 'Product1',
'page callback' => 'node_field_link_products_page1',
'access callback' => TRUE,
'menu_name' => 'primary-links',
'type' => MENU_NORMAL_ITEM,
);
Opening the URL of "admin/build/menu-customize/primary-links" will show the Product1 as a child of Product.

Related Links

Webform send multiple email
How to pull all emails of the site members in og invite new members?
drupal, tree in search form
how to enter words in synonyms.txt file of apache solr search
How to disable/hide the submit function when the form is submitted?
Heirarchical Select Steps Drupal 6
Making views custom field sortable in Drupal on a table view?
Drupal6 - product comparison
drupal 6 multitab with ajax content
How to place a cck field inside a fieldset?
How to display the maxlength countdown remaining characters for custom form fields
How to put the field label inside the form select field?
Symbol “?” in alias or Dirty url
hook_comment not modifying data
How to use php session in drupal 6
Drupal 6, Create a form in a node which save data to another content type (cck)

Categories

HOME
openlayers
osgi
netbeans
amazon-ec2
urbancode
heroku
kde
iterator
grep
read-eval-print-loop
xmpp
cvs
yarn
jxls
sql-server-2016
fancybox
onelogin
ios-charts
bs4
dax
row
ibm-odm
opentracing
django-admin
http-status-code-504
connection-string
physics-engine
errorlevel
kudan
restful-authentication
intel-pin
react-css-modules
spring-mybatis
elasticsearch-ruby
galsim
preg-match-all
uisplitview
siesta-swift
y86
nssegmentedcontrol
plsql-psp
libraries
starteam
squib
galen
firebase-admin
fakeiteasy
vao
menuitem
dotcover
network-flow
jquery-nestable
gabor-filter
setter
kbuild
android-cursor
r-forge
android-textview
url-masking
plottable.js
multiple-regression
angstrom-linux
essence
hover-over
asp.net5
historian
reactive-banana
prerequisites
simple-framework
spidermonkey
ideamart
apache-commons-fileupload
sniffer
system32
proj4js
directoryservices
nsmutabledictionary
facebook-graph-api-v2.4
qcodo
wordpress-theme-customize
device-manager
project-planning
starcluster
navigationservice
valueconverter
bundles
c18
listings
soundtouch
eclipse-memory-analyzer
gridcontrol
android-screen-support
spring-validator
sharp-repository
android-hardware
selected
path-separator
google-email-migration
cascalog
newtonscript
work-stealing
nsdatecomponents
zpt
yetanotherforum
lang
dmx512
revisions
gin
modelstate
zend-decorators
thread-local-storage
uiq3

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App