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 8841537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:44:34+00:00 2026-06-14T10:44:34+00:00

I am not sure if this is an issue with my current setup, or

  • 0

I am not sure if this is an issue with my current setup, or what I want to do.

I have a module that is programatically creating nodes in my Drupal 6 site, and within each I have to provide links in between various nodes.

I basically have a few foreach loops, and within each I have the current path.

For instance:

foreach ($page->category as $category) {
  $category_link = "category/" . $category['id'];

  // generate category pages
  ...
  $content = "<a href='$category_link'>".$category['name']."</a>";
  _create_node($content);

  foreach ($category->article as $article) {
    $article_link = $category_link . "/article/" . $article['id'];

    // generate article page
    $content = "<a href='$category_link'>".$category['name']."</a>";
    $content .= "<a href='$article_link'>".$article['name']."</a>";
    _create_node($content);
  }
}

The issue that I’m seeing is that the link seems to be continually built up.
For instance, in the main category pages it is fine (I’ll see category/1234), and the article link will be fine, but the category link will seem to be longer than it should. Basically, I’ll end up seeing:

category/1234/article/5678/category/1234

My first thought was to make use of $base_url and just create absolute paths, however whenever I try printing that variable from my module it is completely empty. This is on a local server, however when I move it to production Drupal isn’t installed at the root, so I can’t simply add a slash to the front of the link.

  • 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-06-14T10:44:35+00:00Added an answer on June 14, 2026 at 10:44 am

    Try using $GLOBALS['base_path'] to get the base path.

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

Sidebar

Related Questions

I'm not quite sure how to approach this issue: I am creating a web
I'm having the craziest issue with Firefox. I'm not sure if this issue is
Not sure this is a known issue. I’m using VS2012 RC (Ultimate), and Win8
I'm not sure if this is a flask specific issue or if I simply
I'm not sure if this is a simulator issue, but I don't remeber having
Not sure this is possible, but looking to write a script that would return
This is a strange issue and not sure what is going on. I am
Not sure if I'm thinking about this the right way. I have a jquery
Disclaimer: not sure this is WordPress related or not. I'm following a simple tutorial
I'm not sure this is the right forum if it's not please feel free

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.