Primary links are not working because of the function I used to print the link titles. I don't have time to review it right now but this will get solved very soon. If anyone has time to work on this, here is the function:

/**
* Return a themed set of links.
* An override of theme_links()
* Modified to use simple text styling instead of HTML & CSS
*
* @see theme_links
*/
function phptemplate_links($links, $attributes = array('class' => 'links')) {
  $output = '';


  // Change the way primary links are rendered
  if($attributes['class'] == 'links primary-links') {
    $linklist = array();
    $href = $link['href'] == "<front>" ? base_path() : base_path() . $link['href'];

    foreach ((array)$links as $key => $link) {
        $linklist[] = '<a href="'. $href .'"><span class="menu-items"><h3>'. $link['title'].'</h3>'.$link['attributes']['title'].'</span></a>';
    }
    // Return the links joined by a '|' character
    return join($linklist);
  }



  if (count($links) > 0) {
    $output = '<ol'. drupal_attributes($attributes) .'>';

    $num_links = count($links);
    $i = 1;

    foreach ($links as $key => $link) {
      $class = $key;

      // Add first, last and active classes to the list of links to help out themers.
      if ($i == 1) {
        $class .= ' first';
      }
      if ($i == $num_links) {
        $class .= ' last';
      }
      if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page()))) {
        $class .= ' active';
      }
      $output .= '<li'. drupal_attributes(array('class' => $class)) .'>';

      if (isset($link['href'])) {
        // Pass in $link as $options, they share the same keys.
        $output .= l($link['title'], $link['href'], $link);
      }
      else if (!empty($link['title'])) {
        // Some links are actually not links, but we wrap these in <span> for adding title and class attributes
        if (empty($link['html'])) {
          $link['title'] = check_plain($link['title']);
        }
        $span_attributes = '';
        if (isset($link['attributes'])) {
          $span_attributes = drupal_attributes($link['attributes']);
        }
        $output .= '<span'. $span_attributes .'>'. $link['title'] .'</span>';
      }

      $i++;
      $output .= "</li>\n";
    }

    $output .= '</ol>';
  }

  return $output;
}

Comments

summit’s picture

Hi, just a suggestion.
Can't you copy primary links function from another theme?
Does anybody know a primary links functions which could be used for this theme.
Theme is looking great!
greetings, Martijn

ipwa’s picture

I haven't seen a theme that prints out menu descriptions and menu titles the way this theme does. You don't need a function to print primary links because its part of Drupal core, you can just print $primary_links; . I will try to fix this major bug asap.

ShaunPatrick’s picture

Tryed to figure it out but to no avail

falcor’s picture

Any update? Just bumping this with my question. Thanks!

pipicom’s picture

Changed the upper part of your template.php code to this:

foreach ((array)$links as $key => $link) {
        $linklist[] = '<a href="'. base_path() . drupal_get_path_alias($link['href']) .'"><span class="menu-items"><h3>'. $link['title'].'</h3>'.$link['attributes']['title'].'</span></a>';
    }

and it works!

gjones’s picture

You sir, are an internet hero!

ipwa’s picture

Status: Active » Fixed

This has been committed to dev right now, so in up to 12 hours you can download the theme with primary links working. Thanks very much pipicom, I really didn't have much time last month to look into my contrib themes, I'm really glad you sorted it out. You'll get proper credit in the first beta release note ;)

pipicom’s picture

Cool! Thanks. I have already used your theme here: http://tsakirismarine.gr/ though I changed some things

summit’s picture

Would nice to know what you changed..
thanks for considering telling us.
greetings, Martijn

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

apoc1’s picture

Primary links are still not working for the people who can't enabel clean url's. The secondary links do work, primary's not. It links to .../node/1 when it should be .../?q=node/1

Any idea how to fix this? I'm into it now for a while but can't find any solution (don't have a great php knowledge...)

apoc1’s picture

I got it working now by changing the same line in template.php that pipicom changed with the following:

      foreach ((array)$links as $key => $link) {
        $linklist[] = '<a href="?q='. drupal_get_path_alias($link['href']) .'"><span class="menu-items"><h3>'. $link['title'].'</h3>'. $link['attributes']['title'].'</span></a>';
    }

The only thing I noticed is that via this way, you can't link the front in your primary links...

ipwa’s picture

Status: Closed (fixed) » Active

I can confirm primary links don't work with clean urls disabled and when you link to front page, so opening up this issue again.

ipwa’s picture

Status: Active » Fixed

This is not the same issue as the initial one, so opening a new one: http://drupal.org/node/490758

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.