When opening in a modalframe child, we shouldn't open .automodal links in a new modalframe. A modal inside a modal is no longer modal. :-) If anything, they should open in the current modalframe, but using the automodal* GET paramaters.

Original post

Hi to all!, i show a view into a modalframe with automodal it works great but this view has links inside, i want that those links shows in other modal, is it possible?, i put into a class 'automodal' but the link opens in a new page.

Comments

trofiarik’s picture

Hi i have the same issue and looking with no luck for the solution ..

kiwad’s picture

Almost same issue but wanted to use Node relationship within an automodal. The modalframe from Node Relationship starts opening then closes automatically

EDIT :

With Node Relationship, the modal frame into another modalframe works with the "view" and the "edit" buttons, but not with the "search and ref" nor "search and ref multiple at once, so I guess I should look to the issue queue of this module

ryan_courtnage’s picture

Here's what I did:

Add the 'automodal-exclude' class attribute to your link to ensure that the link will not open up in a new window.

Add automodalClose, automodalReload, or automodalRedirect parameters (if needed) as url arguments.

example:

$variables['my_link'] = l('my link', "my/path", array('query' => 'automodal=true&automodalClose=true&automodalReload=true', 'attributes' => array('class' => 'modalframe-exclude')));

EDIT: This doesn't open up a SECOND modal, it allows a the content within your existing modal to change

discopig’s picture

YOUR USERS ARE GOING TO HATE YOU for double modal.

mrconnerton’s picture

Thanks @ryan_courtnage, that did it for me, parameters and all.

dsnopek’s picture

Title: Is possible to make a modalframe into modalframe? » Do something smart with .automodal links that are already inside a modalframe
Category: Support request » Bug report
Issue summary: View changes

When opening in a modalframe child, we shouldn't open .automodal links in a new modalframe. A modal inside a modal is no longer modal. :-) If anything, they should open in the current modalframe, but using the automodal* GET paramaters.

maen’s picture

Thx to @tyan_coutnage, I solved this problem now. For those who are not familiar with the l function, I give here a conflict free version of his code as a renderable array:

'link'=>array(
        '#type' =>'markup',
        '#markup' => l(t('bla'),'url',
                        array(
                            'query' => array('automodal'=>true,
                                            'automodalClose'=>true,
                                            'automodalReload'=>true), 
                            'attributes' => array('class' => 'modalframe-exclude'))),
         '#prefix' => '<div class="btn btn-default form-submit">',//for those who wants this
        '#suffix' =>'</div>'//for those who wants this

Hope this helps someone.