Jump to content

Archived

This topic is now archived and is closed to further replies.

cf666

modal triggered from menu item?

Recommended Posts

cf666

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="https://docs.google.com/spreadsheet/embeddedform?formkey=dHFycFNoUk5XMHJtdUxrUlRXSVJLYVE6MQ" 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!

Share this post


Link to post
Share on other sites
Rob

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.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
cf666

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

Share this post


Link to post
Share on other sites
Rob

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).


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
cf666

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

Share this post


Link to post
Share on other sites
Danny

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.

 

http://www.pagelines.com/pros/


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Shane Holloman

Any update if this is possible yet?


Shane Holloman

IT Specialist | Digital Artist | Web Developer

http://unitedsaints.com

+1(424) 218-6853

 

Share this post


Link to post
Share on other sites

  • Similar Content

    • Liv Kundalini
      By Liv Kundalini+
      Hi -
      Pulling my hair out over here, and would love an assist!
      Site I am building, http://www.livkundalini.com/home, has a problem with the submenu items in the nav not appearing. 
      If anyone wants to see what the Nav should look like, feel free to look in the footer on the left hand side.
      Have tried disabling Pagelines and using the twentyseventeen theme, but problem persists.
      Saw this error (pasted at the bottom of this post) displaying in the inspector, and saw discussion of Jetpack potentially being a culprit. Disabled Jetpack, but the problem persists.
      Had the hosting company even flush the server-side cache, but no avail.
      Any thoughts? Please? It's the only thing keeping me from launching this site!
      Many Thanks,
      Todd
       
      WebSocket connection to 'wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data' failed: Error during WebSocket handshake: Unexpected response code: 403   O @ (index):7
    • russe-intensif
      By russe-intensif+
      Hi team,
      checking my site today, i'm surprised to see my MegaNav all in bottom of the pages, while it's in header.
      After getting to change it in couple of pages onto Template part (too time consuming !), i'm desperate and ask you for help :-)
      apprendre-le-russe-avec-ania.fr
      Thank you in advance !

    • dwpoyner
      By dwpoyner+
      Not sure exactly what is causing the issue. For some reason, why you view my site on mobile, the menu does not show up. It will pop up, but it is black. You can check it out here: http://dev.caryfbc.org. I'm also attaching a screenshot where I shrunk my browser down. Any suggestions?

    • khat
      By khat+
      I think I may have installed pagelines pro incorrectly, and then used features incorrectly. I installed first platforms framework theme and then the child, thinking I could do setup for child later. I tried to set up a background image, and tried custom css feature in pagelines dashboard. I had mistakes in my css, and just thought that if I deleted the info in the css custom feature in pagelines dashboard that the new information would overwrite the old info. The background image didn't respond at all, probably because I didn't have the child directory renamed. I then tried to use the LSS plugin to create css and added more css, possibly, somewhere -sigh-. I never did change the background image and get it placed properly. I used a workaround and in nested containers I placed a background image which worked well enough, so I moved on to try to create my nav bar/ menu bar. When I go to the Menus panel, there is NO area where I can place a menu on a page. I have read and reread and re- re- reread the instructions for placing a menu. I've used the pagelines editor to place a menu, however only HOME shows up. I've been at this for many hours. I've since uninstalled all of my pagelines items and reinstalled, thinking that it would restore all my changes to default, but no, it is still all there, with all my unresolved issues. I am completely at a loss as to what to do next.
    • Jarek
      By Jarek+
      How to make the Impulse menu sticky?
      Here is a site that seems like it is doing just that: http://www.manhattanperiodontist.com/
      Here is the site I am working on: http://boeriu.digitalvector.com/ 
      I have no problem showing the menu at the bottom, but when scrolling up it does not stick.  I tried to add Nav Pro menu but when I do that, it just shows on top and no matter what I try is not working as I want it to.
      Any suggestions?
×