I'm using the front page module with the bluemarine theme and have anonymous users blocked from accessing content. However, when I view the front page as an anonymous user the Edit primary links hyperlink is displayed. What do I have to do to remove that from the front page for anonymous viewers? www.kpsinfo.com is the site if you want to see what I'm referring to. Thanks.

Roger

Comments

Ryanbach’s picture

You either need to edit the theme css or the page template... I can't remember which one at the moment, sorry.

GWL’s picture

"Edit primary links" is only displaying because you have not entered any primary links.

If you don't plan to add any primary links, you can disable the menu by going to administer >> menus (under Drupal 4.7). On versions before 4.7, you can disable the message by going to administer >> themes >> configure and unchecking the "show primary links" box.

If you DO plan to add primary links at a later time, you can always add them and re-enable the menu. As long as at least one primary link is entered, no one will get the "Edit primary links" message.

If you want to add primary links but hide them from anonymous users, then and only then will you need to edit your template files.

Gary

KSA213755’s picture

I created some primary links, but they only display for logged on users. They also display when viewing the front page as anonymous visitor, but only if I have admin > access control > node access content enabled. Seems strange that the "edit primary links" is tied to the access control, but it seems to be.

Roger

GWL’s picture

You might want to submit a bug report about that behavior. Something's definitely not working correctly.

gfroyle’s picture

I am having the same problem.. using Drupal 4.7 (Safari 2.0.3 on Mac OS X if relevant)

I go to administer >> menus but THEN WHAT?

There are three tabs "list", "add menu" and "add menu item" of which "list" is currently open.

The list has a long list of menu items, none of which mention the word "link" or "primary link"...

AHA.. I just discovered that if I click on the word "menus" rather than the word "edit" then I get something mentioning primary links and can follow my nose from there.. either turning it off or not.

Well, that solved that one..

BUT it has raised several more questions for me:

- what is the difference between clicking on an item in the list (eg "menus") and clicking on the word "Edit" next to it?

- why does the default link "Edit Primary Links" not take one to the actual page that deals with primary links rather than to the general menu system?

Cheers

gordon

hitmoments’s picture

you can log in to adminter click on themes in that click on configure and then disable in toggle display primary and secondary links

KSA213755’s picture

In 4.7 the links admin was moved to Administer > Menus. The toggle check boxes that used to reside in the themes admin no longer exist.

Roger

jimsmith’s picture

I even deleted the menu item but the link still showed up.

I had to edit page.tpl.php to get rid of it.

mindprint’s picture

I had the same problem and this is what I did.

clicked the "edit primary link", brought me to admin > menu. I clicked "disable" to the right of menu. I clicked "reset" to the right of menu. It brought me to a page where the primary link settings can be changed.

Hope this helps.

CdnStrangequark’s picture

Huh, that totally isn't what happens for me. I have that Edit Primary (or Secondary) Links thing too but when I click it, it takes me to the theme configuration, where there is no longer any trace of the links configuration since they are in the menu configuration. It looked to me like it's just pointing to the wrong place, but maybe the problem is bigger than that.

sepeck’s picture

Sounds like you are using a migrated site.
Turn on menu module in admin >> modules.
Then go to admin >> settings >> menu.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

bypass’s picture

how do you edit this file to remove "edit primary links"?
I am having the same problem as others in that my Admin->menu page doesnt have a toggle or item for removing the primary links
Bypass

davidrosebaugh’s picture

this worked for me:
Administer -> Settings -> Menus
Menu containing primary links:
No Primary Links

abqaria’s picture

thanks

it worked

wenxin’s picture

Go down the the last "menus"

Administer -> Settings -> Menus
Menu containing primary links:
No Primary Links
Menu containing secondary links:
No secondary Links

Martin Frank’s picture

Thanks that works. Shouldn't it be in the handbook?

sepeck’s picture

http://drupal.org/node/63601

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

Standart’s picture

I upgraded to 4.7. I played around with the menues and the blocks and wanted to get rid of the 'edit primary links'. Now I have no primary nor secondary links in both admin > blocks and admin > menues. Still I have the 'edit primary links' on the top of bluemarine. I wonder how to get rid of it or how to recover the primary and secondary links if I want them back.

sepeck’s picture

In 4.7 Primary and Secondary links have been incorporated into the menu system. Your theme will still need to have the code to display them but behavior is handled through admin >> settings >> menu settings. Then links are added in admin >> menu.

http://drupal.org/node/63601

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

underpressure’s picture

Go to:

Home » administer » settings » menus.

look for "Menu containing primary links:"

set to No primary links

Regards,
underpressure
http://ravalonline.com

mfb’s picture

These tips don't help sites that do want primary links, but also want content accessible only to authenticated users. The only way to make the "edit primary links" disappear would be to add at least one menu item linking to an external site -- this would still show up for anonymous users. Or edit the theme to add some logic e.g.

  <?php if (count($primary_links) && $GLOBALS['user']->uid) : ?>
    <ul id="primary">
      <?php foreach ($primary_links as $link): ?>
        <li><?php print $link?></li>
      <?php endforeach; ?>
    </ul>
  <?php endif; ?>

bug is here http://drupal.org/node/42826
Marked as "by design" I guess because people had trouble imagining a scenario where a site *does* want primary links for the users, but *does not* allow anonymous users to "access content".

jonty_q’s picture

Now I know that trying all the following suggestions won't work for me - I have exactly that scenario, a private site where anonymous users should not see any menu - that bug report talks all about it.
I still haven't finished reading that whole thread, but a pity they marked it "By design" !!! Sure don't seem like good design to me ... or my users! Probably will force me to use the "Front Page" module ... not something I wanted to do at this stage ...

newtoid’s picture

Find the below code in includes/common.inc:

// Special case - provide link to admin/menu if primary links is empty.
if (empty($links) && $start_level == 1 && $pid == variable_get('menu_primary_menu', 0)) {
$links['1-1'] = l(t('edit primary links'),'admin/menu');
  }

And comment it out like so:

// Special case - provide link to admin/menu if primary links is empty.
// if (empty($links) && $start_level == 1 && $pid == variable_get('menu_primary_menu', 0)) {
// $links['1-1'] = l(t('edit primary links'),'admin/menu');
//  }

This allows you to show the primary links if you want to and not show them if you don't.

I assume that this code could be deleted instead of commented out as all it does is cause problems.

'edit primary links' will still show until you delete it from the menu at admin/menu as it is a built in menu item to start with, as is the 'edit secondary links'.

rubenk’s picture

in your paragraph, it says common, but it is menu.inc that one should edit, as in your title. truly awesome. thanks

whereisian’s picture

An elegant solution.

karldied’s picture

Thanks for the posts; here's how I eventually got it. For 4.7, in page.tpl.php, I surrounded the primarly and secondary links (and the search box) with the following conditional requirement (the first and last lines), and now they are visible only for authenticated users.

There probably is some preferred way of making a function call in template.php, but I don't know how to do this, yet.

<?php if ($GLOBALS['user']->uid) { ?>
  <?php if (isset($secondary_links)) { ?><div id="secondary"><?php print theme('links', $secondary_links) ?></div><?php } ?>
  <?php if (isset($primary_links)) { ?><div id="primary"><?php print theme('links', $primary_links) ?></div><?php } ?>
  <?php print $search_box ?>
<?php } ?> 

See also http://drupal.org/node/23449, php code snippets "Display different page content to anonymous and authenticated users."

abethecat’s picture

I had the same problem, fixed it today.

Do like this:

1. Go to "administer"
2."settings"
3."menus"
4."Menu containing primary links:"
5.Scroll down and click on - "No primary links"
6. Problem solved!