• Resolved mickey.moose91

    (@mickeymoose91)


    Hi Yannick Lefebvre,

    This plugin is awesome. I do have a question about it though.

    I’m planning on having the posts on my website open in a modal box when an image or text is clicked. This means that the post will open inside the pop-up. Basically the post link is passing the id to the modal which displays the post.

    I also would like to be able to use this functionality within my php templates (single-page.php etc). So could I code this functionality in php?

    On a side note, is it possible to have the url in the address bar change to the post URL when the link is clicked? If that is not possible, that’s okay. But I really am wondering about full posts in modals.

    Thank you!

    https://wordpress.org/plugins/modal-dialog/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Yannick Lefebvre

    (@jackdewey)

    Hi Mickey. What you are looking for is not possible. You cannot determine dynamically what content will be loaded in the dialog. That needs to be set ahead of time. You will need to create your own custom functionality using colorbox or fancybox.

    Thread Starter mickey.moose91

    (@mickeymoose91)

    Ah I see… So functionality like http://www.usatoday.com isn’t possible? Where if you click an article it will be displayed in a modal window and the url would change to that article URL?

    If I may ask, do you have any idea how they went about achieving this functionality? It is quite impressive. Hypothetically could you give any indication of what they did? That would really help me out.

    Thanks!

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    What they are doing still relatively simple. When display links to articles, they are making a link that will open a light box, with the URL of the target article as the URL. This makes a light box appear with the article in question. Modal Dialog is just not designed for this.

    To get what you are asking for, you would need to load colorbox on your site in the headers, then modify how your template displays links to load them inside of colorbox.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Opening posts in modal’ is closed to new replies.