WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
[resolved] Open Contact Form in Easy FancyBox from Menu item (4 posts)

  1. serojja
    Member
    Posted 11 months ago #

    Hello!

    First of all, I`d like to thank the developers of this beautiful plugin - it is really useful and easy to use.

    Second, I am really far from being good at technical knowledge, so please forgive me my incompetency. So, Id like ask you a question. Lets say I am opening a Contact Form using Easy FancyBox and it works fine when I click on the word combo "Contact Form":

    <a href="#UniqueID-1" class="fancybox">Contact Form</a>
    
    <div class="fancybox-hidden"><div id="UniqueID-1">
    [contact-form-7 id="546" title="0542"]
    </div></div>

    It works perfectly when I am using a picture to open an Easy FancyBox with a Contact Form inside like this:

    <a class="fancybox" href="#contact_form_pop"><img class="aligncenter" alt="" src="http://localhost/localsite/wp-content/uploads/2013/07/tame_small3.jpg" /></a>
    <div class="fancybox-hidden" style="display: none;">
    <div id="contact_form_pop">[contact-form-7 id="546" title="0542"]</div>
    </div>

    But Id like to open a Contact Form by clicking on the menu item on the menu page. I tried to use iframe but it didnt satisfy me as it opened a copy of a page with contact form in it in FancyBox and the page stayed when I submitted the information via Contact Form. I also tried to put the "code" mentioned above into the title of the page Id like to open via menu item but it just opened an Easy FancyBox window with a text: [contact-form-7 id="546" title="0542"], so I didnt succeed.

    Could you please help me and tell me how can I open just an Easy FancyBox window with a Contact Form directly from click on menu item? Is it even possible?

    Thank you!

    http://wordpress.org/plugins/easy-fancybox/

  2. serojja
    Member
    Posted 11 months ago #

    It seems I have managed to find the way to do it and it works perfectly.

    I made the following steps:
    1) Enabled CSS Classes in WP-Admin -> Appearance -> Sceen Options
    2) Inserted "fancybox" into CSS Classes for menu item
    3) Insertd shortcode for my contact form into the page I want to open from menu item like this:

    [contact-form-7 id="546" title="0542"]

    4) Used plugin "Show Content Only" to generate the custom link for the page showing only content
    5) Made the Show Content Only Link as default link for the page I wanted to display in Fancybox (where Contact Form is)

    Works great! Thanks!

  3. RavanH
    Member
    Plugin Author

    Posted 10 months ago #

    Hi serojja, thanks for sharing your solution! :)

    Specially your tip on the Show Content Only plugin which might be useful in many other cases.

  4. Dirty Bill
    Member
    Posted 6 months ago #

    Took this one a step further: To call it directly - add a widget with:

    <div style="display:none" class="fancybox-hidden">
        <div id="contact_form_pop" class="hentry" style="width:380px;height:auto;">
            [contact-form-7 id="648" title="title"]
        </div>
    </div>

    Then put "#contact_form_pop" in the menu url field. Pop!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.