Hello, I am currently working on modifying the output created by the $primary_themes variable.

For my custom theme, I have created a template.php and inside is this function:

<?php function kfstemplate_primary_links($links, $attributes = array('class' => 'links')) {
  $output = '';

  foreach($links as $link) {
  print l($link['title'],$link['href']);
  }

  return $output;
}?>

And this is how I call that function in my template.php

<?php print kfstemplate_primary_links($primary_links); ?>

This works fine on every page EXCEPT the "Page not Found" screen. Why won't any primary nav links show up on that page?

Comments

DirtyBirdNJ’s picture

Hello? Anybody?

There has to be an explanation why the $primary_links variable has no values when displayed on the "Page not found" node. I am using Drupal 6.

DirtyBirdNJ’s picture

Nobody can even call me an idiot and link me to some information on the subject? I've searched all I can and I can't find ANY explanation to the problem.

The Drupal community has been very supportive and answered a bunch of my questions, but this is a big problem for me and it's very frustrating that I can't even get a push in the right direction. I find it very hard to believe that nobody has experienced this, or can be bothered to give me a hint.

I've provided all my code... explained what I'm doing to the best of my ability, and rather than spamming this post with bumps every HOUR I've waited a day each time I post again.

What more do you want?!?!
DirtyBirdNJ’s picture

I hate having to do this, but I still can't find any answers or help.

BUMP.

WorldFallz’s picture

Not sure where you searched, but from my quick search it seems this is the way it works (first link on the search page) and if you specify a custom error page they appear as expected.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

DirtyBirdNJ’s picture

Thank you VERY MUCH!

Reading that issue log explained the situation very clearly.

Not that my input changes anything, but I think it's absolutely ridiculous that your 404 page would not preserve the primary navigation links. Some of the users in that thread were saying that the 404 page serves ONLY to tell the user a file or page dosn't exist.

Why would you not want to give them links to the rest of the page so they can try to find what they want? That's my opinion on usability anyway.

I guess what I'll be doing is creating a node to point to the 404 error, as suggested in that thread you linked me to.

Thanks again WorldFallz!

WorldFallz’s picture

I tend to agree that it doesn't make much sense to lose navigation like that, but it's not a show-stopper for me since there are workarounds. However, you feel that strongly about it, you might want to reopen the issue for additional input and opinions.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz