I have a client that wants their Contact Us form to be displayed in a popup box over the page the visitor was just on, instead of taking visitors to a separate Contact page.
Is there an easy way to do this?
Thanks!
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I have a client that wants their Contact Us form to be displayed in a popup box over the page the visitor was just on, instead of taking visitors to a separate Contact page.
Is there an easy way to do this?
Thanks!
Yes, should be no problem, just take your favourite pop-up div box page thingy (e.g. SS uses greybox within ModelAdmin for has_many relations or facebox (http://chriswanstrath.com/facebox/) is quite nice as it looks like facebook pop-up. Then just give it the URL of a page with that userform in (so the user form will not be a shown in the menu or search).
example with grey box...
GB_show('Cancel Day','urlsegmentofpage/');
example with facebox...
jQuery.facebox(function() {
jQuery.get('urlsegmentofpage/', function(data) { jQuery.facebox(data) })
})
Barry
Barry, thanks for the reply. Where do I enter this code?
That is javascript code so you have several options... I'd advise reading... http://doc.silverstripe.org/javascript and http://doc.silverstripe.org/requirements
Anybody interested in helping me with this on a payment basis? Swaiba?
If you, or anyone else wants to send me stuff to do you are most welcome, I'll make sure my email shows on my profile page.
For this I am sure all the docs are there to get this working...
1)Create a standard page with your User Defined Form
2)Create a second page type, with a .php and .ss (for help on this see the tutorials... http://doc.silverstripe.org/tutorials)
3)In that page init function or the template require the javascript for the popup box
4)in the template add the javascript I gave in my earlier posts with the URLSegment from (1)
(Note (4) should really be to add a new javascript file or add custom so that the javascript can be combined)
Break the task down... get the popup working in test.html on your local machine with nothing special, then get it to load a page, then make your page in ss, then get your page to load the popup, finally get the popup to show the required page with the form on it