I have a separate sub domain and theme for a mobile version of my site. I would like to disable the edit links/tabs for nodes if viewed from that subdomain/theme, but still allow users from editing in the main theme.

Any help or tips will be appreciated.

  • what Drupal version do you use ? – Refineo Sep 16 '11 at 7:53
  • It's for D6, but will have the same issue with a D7 site as well. – bluegray Sep 19 '11 at 5:46

Items should be disabled, if they are usually enabled, but not useful in that particular circumstance. For example, a submit button could be disabled when the form does not validate. Having an item that is permanently disabled raises the question why the item is displayed at all.

If you want to hide the items, you can do this using CSS if there is an appropriate CSS selector. Have a look at the HTML to figure that out.

For Drupal 4.7.x, 5.x and 6.x, you can also remove the links as described on the drupal.org page Remove unwanted tabs from pages.

Note that both methods only remove the link from the page. They do not prevent users from actually editing the page (e.g. by entering the URL manually).

| improve this answer | |
  • I don't just want to hide the links. I don't want the edit form eg. to be accessible from the mobile site/theme at all, just from the main site/theme. But I think I have a better solution - to redirect those pages in .htaccess to the main site. – bluegray Sep 19 '11 at 5:51
  • Oh yeah, almost forgot. The method described at Remove unwanted tabs from pages might work, but it seems hackish, and doing it with hook_menu_alter removes tabs for both themes, so won't work in my case. – bluegray Sep 19 '11 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.