open a form in a fancybox

Permalink Browser Info Environment
Hello,

Can I add a link to a fancybox popup from inside a regular content block? I'd like to have a contact / login form that opens in a fancybox right from the slide, instead of having to open a new page.

Thanks,
Sally

Type: Discussion
Status: In Progress
merasafar
View Replies:
jordif replied on at Permalink Reply
jordif
Hi Sally,

this is a quick demo I have created:http://longstoryshortparallax.15robots.com/fancybox...

I have used the Fancybox Links add-on:http://www.concrete5.org/marketplace/addons/fancybox-links/...

This is what I have done:

1. Add a content block with the link that will open the form block in a fancybox (have a look at the Fancybox Links documentation for more information). Basically you'll need to give the block an ID and then link to that ID. You'll also need to add the "fancybox_links" class to the link.

2. Add the contact form block to the page. Click on it, select Design and go to the CSS tab. Give it an ID, add the "exclude" class to it (so it does not appear in the navigation) and add the following additional CSS:

display:none;


3. Add the Fancybox block to the page. Click on it, select Design and go to the CSS tab. Add the "exclude" class and the same additional CSS.

Hope this helps!

Jordi
merasafar replied on at Permalink Reply
merasafar
Thankyou so much! it works beautifully (except in Opera on a smartphone). Thankyou for very clear instructions.
alsworld replied on at Permalink Reply
alsworld
Just following on from this...I've just tried exactly this process you describe but I think it no longer works ? Can you please re-check? I'm using Concrete 5.6.3.5 and trying with Fancybox links 1.0 from the Marketplace

When i follow the instructions by creating a content block with a link in it pointing to the "#form" block i have hidden and click the link nothing happens. Adding the fancybox links block into the page actually makes the admin edit bar disappear which in the fancybox support forum is identified as being a reference to the wrong version...

as per:

https://www.concrete5.org/marketplace/addons/fancybox-links/support/...
jordif replied on at Permalink Reply
jordif
Hi!

You should ask in the Fancybox Links support forum.

The theme is not loading fancybox at all, that's why I suggested using an add-on.

If the add-on is loading a wrong version of fancybox, then you should ask the add-on creator.

Sorry for not being of much help,
alsworld replied on at Permalink Reply
alsworld
Thanks Jordi.
Is it possible to link to a block hidden with "display:none;" on the same page and cause it to display just using CSS without needing a fancybox?
regards,
Alex
jordif replied on at Permalink Reply
jordif
Hi Alex,

not sure how it would look, but basically you could try this:

<a onclick="$('#myblock').show()">Click here</a>


(Where myblock is the id of the block you want to display)

Cheers

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.