With the release of Drupal 7 just two weeks away, I was wondering if there are any plans for a Drupal 7 version of the Special menu items module?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jacques.van.nes’s picture

Now drupal 7 is released i am in an upgrade process.
Unfortunately there is nu 7 release (yet) available.
Does anyone know when the version 7 release of special menu items will be available, or is there any alternative project for this?

Thanks in advance
Jacques

Anonymous’s picture

subscribe

webflo’s picture

Here is a Drupal 7 version. There is no upgrade path from d6 to d7 is not included. Please test and review.

Anonymous’s picture

You can also include this script in your .info file:

(function ($) {
	$(document).ready(function() {
		$('a.nolink').live('click', function(event){
			event.preventDefault();
		});		
	});
})(jQuery);

Then add this to your custom style sheet:a.nolink {cursor:default;}… and finally, add the class "nolink" to your special menu items.

It's not an ideal solution, as it requires client side scripting, but I don't know how to do this in PHP. If anyone does, how about posting the solution here?

Note: tested only in Chrome browser.

webflo’s picture

This is not related to this patch/issue.

webflo’s picture

Status: Active » Needs review
hrpr.com’s picture

Category: support » task

Tested patch and works for me after a couple of tweaks, one to speciaL_menu_item.info file and one to my theme's css file.

I deleted the following from bottom of special_menu_item.info file:

; Information added by drupal.org packaging script on 2010-02-21
version = "6.x-1.5"
core = "6.x"
project = "special_menu_items"
datestamp = "1266755706"

And added this in it's place:

version = "7.x-1.x-dev"

In my test theme, which is a modified version of Tarski theme, changed following in the style.css file:

li.nolink-li to li.nolink

See it in action on News item on top horizontal menu of my test site.

Juc1’s picture

sub

carlovdb’s picture

Category: task » support
Status: Needs review » Active

subscribe

n3uronick’s picture

I would also propose to change the line 32 to:

$items['admin/config/system/special_menu_items'] = array(

webflo’s picture

Thx for the reviews. I rerolled the patch. I change the menu path to 'admin/config/system/special_menu_items' as proposed by neuronick in #10.

enkara’s picture

I can't get it to work.

It displays this message error:
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'pastwoman_menu_link' not found or invalid function name en special_menu_items_menu_link() (línea 81 de /home/pastwoman/web/sites/default/modules/special_menu_items/special_menu_items.module).

Also, I've debugged a little bit and althoug I have 'nolink' items, it does not enter to this if:

// Add a class to the list item
  if (in_array($element['#href'], array('nolink', 'separator'))) {
    $element['#attributes']['class'][] = $element['#href'];
    
    if ($element['#below']) {
      $sub_menu = drupal_render($element['#below']);
    }
    
    switch ($element['#href']) {
      case 'nolink':
        $tag = variable_get('special_menu_items_nolink_tag', '<span>');
        $title = strip_tags(l($element['#title'], $element['#href'], $element['#localized_options']));
        $output = special_menu_items_render_menu_item($tag, $title);
        break;
        
      case 'separator':
        $output = variable_get('special_menu_items_separator_value', '<hr>');
        break;
    }

It seems like is getting only the shorcuts menu!

Thank you for your help

bryancasler’s picture

subscribe

ralva83638’s picture

subscribe

webflo’s picture

Status: Active » Needs review
FileSize
15.72 KB

Rerolled the patch. My github repository: https://github.com/webflo/special_menu_items

enkara’s picture

Thank you, but I'm still getting the warning and it's not working for me :(

rob49152’s picture

I've been trying my hand at adding a 'self' functionality to this module with little luck. Granted I've put in a whole 2 hours in total.

Basically the idea is that if the menu path is set to 'self' it would replace the tag with <a href="#"> and end with </a>

And don't you think these should actually be <nolink>, <separator> and <self> to be consistent with drupals formatting and to avoid conflict issues if for some strange reason someone actually had a page with the path being 'nolink', 'separator' or 'self'?

webflo’s picture

And don't you think these should actually be , and to be consistent with drupals formatting and to avoid conflict issues if for some strange reason someone actually had a page with the path being 'nolink', 'separator' or 'self'?

Full Ack

bryancasler’s picture

Made my day

dgastudio’s picture

sub

willybase’s picture

subscribe

kruser’s picture

sub

Jiri Volf’s picture

subscribing

ivadenis’s picture

how to install this module on Drupal 7?

bittertruth’s picture

menu shows up.. but I can't get the formatting. it's plain text. Any idea??

ranpan’s picture

Ok I installed the drupal 7 version. Now my parent links that i have set to "nolink" it gos to mysite.com/nolink page that says "This is a dummy page used for placeholder and separator menu items. You should not be able to see this page " What did I miss? Anyone else have this problem? I'm not sure why it actually shows the link and goes to that page.

DartDev’s picture

After uploading module from https://github.com/webflo/special_menu_items it tells: contains a version of clippy that is not compatible with Drupal 7.x. on modules page.

clashar’s picture

sub

Juc1’s picture

Hi all,

Is there any news on a D7 version or if not can anyone please suggest an alternative D7 module for a placeholder menu item?

Thank you

ckrina’s picture

I installed the (https://github.com/webflo/special_menu_items) correctly, and it works fine in my D7 site.

The problem I have is that I want to use it with the DHTML menu module to expand the child menu items when I hover the parent-nolink item, and it doesn't work: it is not a link so it doesn't act as it.

Any idea? Thank you

Ortaga’s picture

This is a interesting option for D7:
http://drupal.org/project/menu_firstchild

taoofbean’s picture

Thanks so much for making the D7 version of this module.

Note: for those of you trying to install this from Github, you likely need to individually download the individual files for the module into a folder of the same name because the predefined Downloads for the module on Github are all for the 6.x version.

Juc1’s picture

@ taoofbean is the D7 version ok? why isn't it uploaded here?

ckrina’s picture

Thanks Ortaga,
I finally used the DHTML (http://drupal.org/project/dhtml_menu) module and used its option "None". It was exactly what I was looking for.

BenK’s picture

Subscribing

bryancasler’s picture

subscribe

gagarine’s picture

straszko’s picture

Is 7.0 release hanging in the air? :)

Regards

gagarine’s picture

yeah a D7 version is ready and better than the D6. I asked Servit to commit or to give me the accesses to the repository but he didn't answer for the moment.

geek-merlin’s picture

gagarine’s picture

Category: support » task
Status: Needs review » Reviewed & tested by the community

Yep but before than we can commit on the d.o I will not try to fix every issue here... I think this issue (porting the module to D7) is done, now we need a commit and a 7.x branch.

Axel you can try my version https://github.com/gagarine/special_menu_items perhaps it will solve the issue (don't forget to run update.php and backup before you run it.... it's still beta).

webankit’s picture

+1 waiting for dev

kporras07’s picture

Priority: Normal » Major

This module version is giving me some problems; because the page tries to link to a page named ; i need to solve this; could yo help me?

I'm a newbie with drupal

jive01’s picture

I installed the module successfully (the version on github) however my output when using <nolink>

Outputs the following:

<a title="" href="/drupal/%3Cnolink%3E">Other</a>

So the options to configure your own html tag in the configurations does not work, nor is the menu item wrapped by the default span tag that it is supposed to be in...

jive01’s picture

I realize that this is happening because my menu is a custom menu! There needs to be a way so that the nolinks and separator works for custom menus as well...

straszko’s picture

Hello @jive01. Could you please tell me which files did you use to install special_menu_items module? Are you using Drupal 7.2?
I can't get it work on my installation (i get message "Current version is not compatible...")
Thanks.

gagarine’s picture

@jive01 I can't reproduce your bug. and is not critical.

Ok every body has a hard time to download from github apparently... I also uploaded a zip with my last version for D7 module attached to this comment.

EDIT: don't forget to clear your cache, run update.php, ...

Screen shot 2011-06-24 at 8.24.25 PM.png

gagarine’s picture

straszko’s picture

Thanks @gagarine. Now i could enable the module. Thanks again. Although i don't think it's working properly for me... I linked one of my menu item to "nolink", and when i click on this item it redirects me to "page not found".. (btw before i did that i've cleared the cache) Am i doing something wrong?
Cheers

ps. hope this project will be continued.. and your work appreciated!
Thanks for sharing!

gagarine’s picture

@straszko Good. For the D7 version, I change "nolink" to "<nolink>" so be sure to use "<nolink>". This is to keep consistency with the core and other modules.

I made an upgrade path for people coming from the D6. If you update from D6 to D7, you absolutely need to run http://yoursite.com/update.php and follow the instruction.

straszko’s picture

@gagarine Sorry for not being too precise earlier.. of course i used "nolink" within the "< >" bracket, and unfortunately (as i described ) i was redirected to "page not found"..
Thanks for your help.

webankit’s picture

I tried to use it with dhtml menu & the children were suppressed any help?

vdeparday’s picture

I am using the superfish menu and I am getting page not found because it is trying to go to / Any tips as to where I should look in the code to fix that?

Thanks

jive01’s picture

@gangarine I believe @straszko and I are referring to the same bug. That is because on a custom menu the <nolink> ends up becoming: %3Cnolink%3E and does NOT wrap it in a span. There for it is redirecting the link to a <nolink> page (which of course, doesn't exist)...

jive01’s picture

@gangarine - I believe this is a Drupal 7 menu issue: http://www.palantir.net/blog/use-menus-drupal-7-you-need-menu-block-module . And I think a "self" option would be a great thing as suggested by @rob49152 .

kuroneko007’s picture

Subscribing, have the same issue that <nolink> links to www.example.com/<nolink>, which doesn't exist. Using Nice Menus.

skolesnyk’s picture

Same bug here with Gagarine's version of D7 module (submitted bug here https://github.com/gagarine/special_menu_items/ )

To clarify: menu is displayed using superfish module. So main menu item display after the base url.

Tjabine’s picture

Same bug here with D7

omercioglu’s picture

sub

tkrajcar’s picture

Subscribing...

VM’s picture

The project is marked as abandoned/obsolete per the project page. That said, if someone in this thread wants to maintain the module and the current maintainers aren't responsive after two weeks. Those will to maintain need to file a webmasters issue to take over said module per the abandoned projects protocols.

see: http://drupal.org/node/251466 for more information

geek-merlin’s picture

@webflo & @gagarine: are you willing to go for being new maintainers?
i would very mouch encourage that.

ps: what do you think about #1221294: option to use <a href="#"> for "nolink" items to not break other modules?

webflo’s picture

gagarine is the new maintainer. see #1187464: Special menu items appears to be abandoned. I offering co maintainership for Drupal 7 branches.

skolesnyk’s picture

Does anybody see following errors when editing a menu item in D7 with this module activated:
* Notice: Undefined index: link_path in special_menu_items_form_menu_edit_item_alter() (line 157 from ../sites/all/modules/special_menu_items/special_menu_items.module).
* Notice: Undefined index: #description in special_menu_items_form_menu_edit_item_alter() (line 166 from ../sites/all/modules/special_menu_items/special_menu_items.module).

I'm using latest git version from webflo, Drupal 7.4, Superfish menu

Edit: it seems the problem is related to combination of Special Menu Item and Menu Tokens modules. After Menu Tokens is uninstalled, errors are gone.

TimelessDomain’s picture

#64 - i am getting the same errors Menu Tokens
Also getting same error as #56 - using superfish

skolesnyk’s picture

Superfish maintainer suggested one line change in superfish.module
Change this line in superfish.module from
$output['content'] .= l($menu_item['link']['title'], $menu_item['link']['link_path'], $link_options);
to
$output['content'] .= l($menu_item['link']['title'], $menu_item['link']['href'], $link_options);

But that doesn't work with Special Menu Items -- I still have "nolink" after site url.

VM’s picture

ensure a cache clear after altering that line. Menu's tend to be cached IIRC

pwhiteside’s picture

I get same problem as #56, kuroneko007.

I am also using nicemenu.

if i use < seperator > (no space) I get "http://sitename/< seperator > (no space)
if i use < nolink > (no space) I get "http://sitename/< nolink > (no space)

Any help would be greatly appreciated. :D

Thanks, the Whiteside of life.

skolesnyk’s picture

Clearing cache didn't help. Still full site url + #, instead of just # for the href location of a menu item.

kevinwalsh’s picture

FileSize
13.19 KB
16.99 KB

My experience with bug reported in #56:

1. I changed the nolink setting to <nolink>

2. I changed the link for a menu item in my primary menu to <nolink>

3. I cleared cache.

Outcome:

On the "List links" page for the main menu (admin/structure/menu/manage/main-menu), the link for the menu item goes to http://example.com/<nolink>

On a non-admin page, like the homepage, the menu item is greyed out, as in screenshot.

In a nice_menus block, the menu item is not greyed out, and goes to http://example.com/<nolink>, as in screenshot.

Cardinals27’s picture

I'm having the same issues as others here. I've installed the D7 update and have the module enabled. I've placed <nolink> as the path value in the menu item, but it's spitting out:
<li class="menu-path-nolink"><a href="/%3Cnolink%3E">Link Text</a></li>
as the source, which displays as:
<li class="menu-path-nolink"><a href="/<nolink>">Link Text</a></li>

as you can see it's also not placing the span tags like the D6 version does.
anybody found a workaround for this?

marcoka’s picture

i can confirm that menu modules taht somehow genereate their own markup liek suckerfish, supergish, nicemenu have problems with the because they generate a link

http://screensnapr.com/v/245LBP.png

marcoka’s picture

if you edit a views generated menu item:

http://screensnapr.com/v/aY9shy.png

wla_g’s picture

I've had a similar issue with custom breadcrumbs in D6 and solved it via jQuery with a simple script, that could help in D7 for similar issues. Of course, you'll have to tweek the script a litte bit. here is is

$(document).ready(function () { 
  $('div.breadcrumb a[href*="nolink"]').each(function () {
    $(this).replaceWith( "<span>" + $(this).text() + "</span>" );
  });
});
skolesnyk’s picture

Read this thread http://drupal.org/node/1190688 -- there's a fix for this bug.

gagarine’s picture

@Webflo Sorry I didn't see I was maintener :/ (drupal.org *need* a way to track the issu you want). I added you too.

I going to take first my branch from github and so we can work...

rumblewand’s picture

Have been successfully using the D7 branch of this module and got it to work with superfish AND mega menu based on the thread posted by skolesnyk in #75 above.

Only thing now is to get it working with custom breadcrumb module. I will experiment with the javascript in #74.

gagarine’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

I just made a 7.x-1.x-dev release... just wait than is packaged by the server.

Status: Fixed » Closed (fixed)

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

patrykk’s picture

Assigned: Unassigned » patrykk
Status: Closed (fixed) » Active

Hi
I use nice menu and stil have same problem as #68 #70
http://example.com/,
enyone know how to fix it or just use Superfish

gagarine’s picture

Status: Active » Closed (fixed)

Please open new issue. Keep this one close.