Modal window not working from within MD Menu

khm's picture
khm
Thu, 02/22/2018 - 08:30
#1
Modal window not working from within MD Menu

Hi

Have noticed that when adding a modal link to md menu top level the modal window is not opening

/modal_forms/nojs/login

is not working, onclick one is redirected to a login page (not the modal window)

Rgds

Congnv's picture
Congnv
Mon, 02/26/2018 - 04:26

Hi Khm,

It will not be able to open modal with only url .
usually, you have to input more class name or attributes or script

khm's picture
khm
Mon, 02/26/2018 - 04:50

Thanks Congv

how would you suggest its done? Using https://www.drupal.org/project/modal_forms

Rgds

cindy's picture
cindy
Wed, 02/28/2018 - 02:32

Hi,

We will add option to add class name for menu item link in next version

For temporary solution, you can follow this instruction:

Open file: md_megamenu/templates/menu/md-awemenu-item.tpl.php

Add the following code above line declaring tag <li>:

<?php
if($item_url == '/modal_forms/nojs/login'){
$item_link_classes[] = 'ctools-use-modal';
$item_link_classes[] = 'ctools-modal-modal-popup-small';
}
?>

Go to admin/config/development/performance and remove Drupal  cache to update file template

Check front end

http://prntscr.com/ikph85

cindy's picture
cindy
Wed, 02/28/2018 - 02:32

Hi,

We will add option to add class name for menu item link in next version

For temporary solution, you can follow this instruction:

Open file: md_megamenu/templates/menu/md-awemenu-item.tpl.php

Add the following code above line declaring tag <li>:

<?php
if($item_url == '/modal_forms/nojs/login'){
$item_link_classes[] = 'ctools-use-modal';
$item_link_classes[] = 'ctools-modal-modal-popup-small';
}
?>

Go to admin/config/development/performance and remove Drupal  cache to update file template

Check front end

http://prntscr.com/ikph85

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.