By maozet on
Hey,
I am using aqua marina theme which creates the primary links as follows( in template.php in preprocess_page)
vars['primary_links_tree'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
How can i add a link to the primary link. It should be in the following format:
user/4/album
i have added the following:
function phptemplate_preprocess(&$vars) {
global $user; // Get the current user
if ($user->uid > 0)
$vars['primary_links'][] = array( 'title' => t('Methods'),
'href' => 'user/' . $user->uid. '/myalbum');
}
.....
....
$vars['primary_links_tree'] = theme('plinks', $vars['primary_links'], array('class' => 'links primary-links'));
This works fine except for the html tags & attributes. So my link comming out in a wrong format.
Any idea?
regards,
Comments
You can do that from the menu
You can do that from the menu administration page.
How (%user)
How do i add a link like:
user/%user/album
Make sure you enable the Path
Make sure you enable the Path module, and then you can make the urls for each page you create whatever you want them to be. Additionally, if you install and enable the Pathauto module, you can configure it so that your urls are generated like you want them to be automatically when you create the document.
Well...i am afraid this doesn't solve my issue
As far as i know, path module allows you to create an alias for a path.
ie: movies --> taxonomy/1/2
I would like to add a dynamic primary link
user/%user/album
How do i do this?
Have you looked at me
Have you looked at me aliases.