By owntheweb on
Hello.
In a standard drupal theme, I have 3 primary links:
- Overview: goes to front page
- Test View: goes to a view listing
- Background: goes to a page node
The links look like "/", "/test-view", and "/background"
The issue: In my custom theme, I need to parse $primary_links into an altered list with added span tags. the href of the links look like "<front>","test-view","node/2". How do I correct this?
Thanks much. :)
Comments
Are you using Pathauto
Are you using Pathauto module: http://drupal.org/project/pathauto
Yes. I think there's an issue
Yes. I think there's an issue with my template functions. It looks and works 'right' when using standard theme() function, but not in my own. Here's what I have. Do you see an area I can improve upon to get this working?
in page.tpl.php:
if (isset($primary_links)) { print get_summit_primary_links($primary_links); }in template.php:
Worlds to explore. Worlds to create.
Blog: http://www.christopherstevens.cc/blog
Twitter: http://www.twitter.com/owntheweb
Hmmm. I think the secrets are
Hmmm. I think the secrets are in the l() function. I'm still looking into it, but any thoughts on how to make this work if I have to have a span tag inside the tags?
Worlds to explore. Worlds to create.
Blog: http://www.christopherstevens.cc/blog
Twitter: http://www.twitter.com/owntheweb
Success! This function
Success!
This function magically turns "" and "node/2" into "/" and "/background" :)
print url($some_link);Here's the updated template.php file that let me customize my primary nav menu for all who may find this useful:
Worlds to explore. Worlds to create.
Blog: http://www.christopherstevens.cc/blog
Twitter: http://www.twitter.com/owntheweb