Jump to content


Photo
- - - - -

modal triggered from menu item?

modal customization menu

  • Please log in to reply
6 replies to this topic

#1 cf666

cf666

    Advanced Member

  • Members
  • 44 posts
  • LocationLos Angeles, CA
  • Country: Country Flag

Posted 30 December 2012 - 11:16 PM

Hi all,

 

Just wanted to know if it's possible to trigger a modal (that opens up a google docs form, essentially an external link) directly from a menu item (in the nav).

 

I've seen other threads that show how to trigger modals from links, etc, but I just can't figure out how to make that happen from a menu item... except using a plug in like Easy Modal, which I've tried and I don't like how their modal doesn't center in the viewport on mobiles (or how their modal looks either, designwise).

 

So if I have this markup to trigger the modal:

<a class="texttrigger" href="#myModal" data-toggle="modal"><img goes here></a>

 

And then this for the modal itself:

 

<div class="modal hide fade" id="myModal" tabindex="-1" role="dialog">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal">×</button>
<h3 id="myModalLabel">The modal's title</h3>
</div>
<div class="modal-body">
<iframe src="

Please Login or Register to see this Hidden Content

" width="760" height="1051" frameborder="0" marginheight="0" marginwidth="0">Cargando...</iframe></div>
</div>
 
How can I adapt this to a menu item?
Any help would be immensely appreciated!


#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 31 December 2012 - 12:11 AM

Go to Dashboard > Appearance > Menus and click "Screen Options" on the top, right. A new panel will open.  Check the box for CSS Classes, then click the Screen Options button again.

 

Now, go to Menus > Custom Links (same page).   Create a menu link with the Link ONLY -- #myModal

 

Add the class title in the new CSS Class field -- texttrigger

 

If you're using an image instead of text for this link, enter the HTML for the image link in the LABEL field - <img src="....

 

Save the menu item.

 

Make sure your CSS is as described in your post.

 

Now that menu item should link, calling the CSS for the modal.



#3 cf666

cf666

    Advanced Member

  • Members
  • 44 posts
  • LocationLos Angeles, CA
  • Country: Country Flag

Posted 31 December 2012 - 12:40 AM

Firstly:

Rob: I LOVE YOU for replying so quickly!!!!!!!!!!!!!

 

Now, I'm a bit confused:

 

When creating the Custom Link menu item, do I enter literally "#myModal" (without the quotes, of course) in the URL field?

The markup I referenced above I had it applied to a button within the body of a page I'd created.

Now that page (and the button within it) wouldn't exist, since the external link that the button triggered will now be triggered by the Custom Link on the menu, right?? So the "#myModal" string wouldn't be referencing anything that exists anywhere on any page! I'm totally confused...

 

By the way, I'm not sure what you mean by "Make sure your CSS is as described in your post" (I'm assuming you meant the HTML, not the CSS?).

 

Please clarify for this clueless beginner...

Thanks a million!!

 

Carina



#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 31 December 2012 - 01:34 AM

Well, first let me say... even I'm surprised it sorta worked. We did get a modal. It just doesn't contain anything. That's my fault, for being quite weary today. I confused all those divs, somehow with CSS.  Apologies. 

 

Somehow we need to call that stuff into the link.  I'm not sure how and our support team really won't be back till Wednesday.  Tomorrow morning, I'll reach out to one of my colleagues to see if there's a solution for calling the modal to open with content. 

 

In Firebug, the modal link is calling a google spreadsheet, but it's doing so as an href link (a normal URL link) instead of as an iframe (which Menus don't normally do).



#5 cf666

cf666

    Advanced Member

  • Members
  • 44 posts
  • LocationLos Angeles, CA
  • Country: Country Flag

Posted 31 December 2012 - 06:15 AM

It didn't work.

The modal you're seeing is an ugly one that is the product of a plugin called "Easy Modal".

I much prefer the design of the Pagelines modals, especially because they load correctly in the viewport so they can be seen entirely (as opposed to this one which in mobiles gets cut off).

I'm using these Easy Modals to make do for the time being but I hope you guys can tell me how to use the Pagelines modals...

 

Please let me know when you find out.

Thanks, Rob!

 

Carina



#6 Danny

Danny

    Is Awesome!

  • Moderators
  • 16289 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 31 December 2012 - 07:31 AM

Hi Carina,

 

The PageLines modal is actually a Bootstrap modal and its not possible as far as I know to trigger the modal from a menu item. I recommend you contact one of our Pros, as they may be able to help you.

 

Please Login or Register to see this Hidden Content



#7 Shane Holloman

Shane Holloman

    Member

  • Members

  • 19 posts
  • LocationAustin, TX
  • Framework Version:2.4.4 Pro
  • Country: Country Flag

Posted 29 August 2013 - 10:50 PM

Any update if this is possible yet?







Also tagged with one or more of these keywords: modal, customization, menu