Jump to content


Photo
- - - - -
Resolved

How To Pop A Modal From A Hook

modal bootstrap hook bootstrap modal hook

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1 blatka

blatka

    Member

  • Members

  • 23 posts

Posted 27 October 2012 - 09:42 PM

My understanding is that you can't use shortcodes inside pagelines hooks, but need to use the php that's behind the shortcode instead. I'm trying to place a button in a hook to open a bootstrap modal that displays another website. I can do that from a widget I'm using in a footer:


[pl_modal title="Newsletter Sign-Up" type="btn" colortype="info" label="Newsletter Sign-Up"]
[pageview url="

Please Login or Register to see this Hidden Content

height="630px" width="100%"]
[/pl_modal]

As you can see I'm using a shortcode inside a shortcode here. But what is the php behind these shortcodes? I can't seem to find them elsewhere.

Thanks

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 27 October 2012 - 10:15 PM

Well, honestly, I wouldn't know what that PHP is either. However, there's one other point you may have missed. You can also use standard HTML inside hooks too. So, if you wanted to use an HREF tag for the link, you could wrap it in a unique div, giving that div padding, margins and a background (the button).

The bigger question is, where do you want the button to appear?

#3 batman

batman

    Bat Learning

  • Members

  • 2203 posts

Posted 27 October 2012 - 10:16 PM

Hi blatka
One question:
This shortcode "pageview" need PageView plugin that will display another web page inside the current post.
Are you use this plugin?

#4 Evan Mattson

Evan Mattson

    Super Member

  • Members

  • 233 posts

Posted 27 October 2012 - 10:20 PM

Hey Blatka,

You could use a shortcode with a hook, you just also have to give it the instruction to be processed.

For example:

Please Login or Register to see this Hidden Content


You will need to escape any single quotes you have in your shortcode content with a backslash like so ( \' ) if you have any to keep it from breaking your string prematurely. The example code should work as-is as long as you change the hook to a real hook.

You can check out the php for all of the pagelines core shortcodes in

Please Login or Register to see this Hidden Content

!

#5 batman

batman

    Bat Learning

  • Members

  • 2203 posts

Posted 27 October 2012 - 10:58 PM

Hi again
I use your code in a simple post

Please Login or Register to see this Hidden Content

and this donĀ“t work
then I modify for

Please Login or Register to see this Hidden Content

This work fine to me

#6 blatka

blatka

    Member

  • Members

  • 23 posts

Posted 28 October 2012 - 01:59 AM

Thanks Evan . That worked great for me!

#7 Danny

Danny

    Is Awesome!

  • Moderators
  • 17653 posts

Posted 28 October 2012 - 10:15 AM

The topic was marked as resolved.