I'm creating a custom navigation bar in drupal. I went ahead about this by creating it as a block and gave it all the neceassary CSS, but something that is not quit clear to me is how can I avoid the hard coding for the links? or any other ways that I can achieve the same result?

1 Answer 1


You should create a menu for this (drupal menus works with system paths, no need to "hardcode" the links) and display this menu in a block where you want.

  • @soju:Thanks for taking your time to answere this question,but I'm trying to build a custom navigation bar and I beleive that drupal's menu system is based on <ul> and <li> and generated through some .inc php file. what I need to do is to create a <ul> like below: <ul> <li class="item"></li> <li class="divider"></li> <li class="item"></li> <li class="divider"></li> <li class="item"></li> <li class="divider"></li> </ul>
    – Nino2armando
    Commented May 12, 2011 at 20:01
  • 1
    I think you go in the wrong way, you can use css to display drupal menu like you want, no need to add useless divider item. Anyway, you can easily theme menu in drupal : api.drupal.org/api/drupal/includes--menu.inc/group/menu/6
    – soju
    Commented May 12, 2011 at 20:20
  • hey thanks for your advice. sorry for the delay I'm just getting used to the site. Commented May 28, 2011 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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