Jump to content


Photo
- - - - -

Modal Dialogue On Page Load


Best Answer catrina , 27 November 2012 - 06:16 PM

There isn't a way to get the modal to open up automatically, but I believe there should be plugins for this. What kind of information are you trying to add to the modal? A link? A Facebook Like box? Go to the full post


  • Please log in to reply
11 replies to this topic

#1 paul_t

paul_t

    Super Member

  • Members

  • 154 posts
  • Framework Version:DMS 1.1.6
  • Country: Country Flag

Posted 27 November 2012 - 06:10 PM

Is there any way to get a modal dialogue to open on page load (overlay the page)

i.e. the user is required to click something in the modal box (like a warning or a notice) to get the page to load?

Would be great to have this option with the editablity and flexibility that the current modal/button shortcode has.

modal shortcode open
Modal popup content
modal shortcode close

tia

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 27 November 2012 - 06:16 PM   Best Answer

There isn't a way to get the modal to open up automatically, but I believe there should be plugins for this. What kind of information are you trying to add to the modal? A link? A Facebook Like box?

#3 paul_t

paul_t

    Super Member

  • Members

  • 154 posts
  • Framework Version:DMS 1.1.6
  • Country: Country Flag

Posted 27 November 2012 - 07:35 PM

Before the page opens, the user has the option to...

a ) click a link to go elsewhere
b ) agree to an information box - click the checkbox and open the page

(within the modal popup)

#4 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 27 November 2012 - 09:04 PM

Might be something of use here:

Please Login or Register to see this Hidden Content



#5 paul_t

paul_t

    Super Member

  • Members

  • 154 posts
  • Framework Version:DMS 1.1.6
  • Country: Country Flag

Posted 11 December 2012 - 10:44 PM

Went a different route

 

and yes - I know you shouldn't tinker with the actual code

 

but if you amend (slightly) the php class.shortcode.php for Bootstrap Modal Popup from line 1300

Please Login or Register to see this Hidden Content

 

you then have a new parameter to use in the shortcode

"show" 

which can be false (default needs a button click to launch)

or true - whereby the modal loads over the page - straight away without the first button click

 

[pl_modal title="Title" type="btn" show='true' colortype="info" label="Click Me!"]

 

all seems fine - but not good to mod the original files so....

 

Question: Probably a Wordpress thing(still a bit new to modifying WP code) - but If I put the whole (modified) function in my child base theme's function.php

and revert the class.shortcodes.php  - it doesnt overwrite the function? confused



#6 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 11 December 2012 - 11:54 PM

You can only define functions once, its a PHP thing.

 

Submit this as a ticket and we'll consider it for inclusion.



#7 paul_t

paul_t

    Super Member

  • Members

  • 154 posts
  • Framework Version:DMS 1.1.6
  • Country: Country Flag

Posted 12 December 2012 - 12:08 AM

Just copy the whole thing to 

Ideas and Feedback ?



#8 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 12 December 2012 - 12:10 AM

No open a bug ;) 

Please Login or Register to see this Hidden Content



#9 paul_t

paul_t

    Super Member

  • Members

  • 154 posts
  • Framework Version:DMS 1.1.6
  • Country: Country Flag

Posted 12 December 2012 - 12:12 AM

will do

 

ta



#10 paul_t

paul_t

    Super Member

  • Members

  • 154 posts
  • Framework Version:DMS 1.1.6
  • Country: Country Flag

Posted 03 April 2013 - 08:09 PM

Did this get implemented? If it did the docs don't mention it?



#11 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 03 April 2013 - 09:00 PM

Yes it did, just add show="true" to the modal shortcode.



#12 paul_t

paul_t

    Super Member

  • Members

  • 154 posts
  • Framework Version:DMS 1.1.6
  • Country: Country Flag

Posted 03 April 2013 - 09:06 PM

Nice - spread the word in the Documentation.