Setting up a 'Contact' form in PivotX..

Discuss PivotX 2.0.x here. Non-PivotX related discussions go in The Drain.

Setting up a 'Contact' form in PivotX..

Postby Bob » Wed Oct 08, 2008 4:40 pm

Hi, sometimes people ask how they can set up a form on their sites, so people can contact them.

Probably the easiest and best way to do this, is using the excellent "GBCF-v3 Secure & Accessible Form Script", which you can get here: http://green-beast.com/gbcf-v3/

Setting it up in PivotX will take about 10 minutes. A bit longer, if you want to tweak the CSS more. We're going to do this in two steps: First, set up the script itself, and then we're going to add a page in PivotX to show the form inside our own template/layout.

First some general setup stuff, for the form script:

  • Download the GBCF-v3 scripts from http://green-beast.com/gbcf-v3/
  • Extract the file, and upload the 'gbcf-v3' folder to the root of your site, where the pivot/ folder is also.
  • Follow the instructions in the supplied readme.txt with regard to configuring the config.php file. Do this up to and including step 8. You don't have to do step 9!
  • The script is quite extensive. You'll probably want to set a lot of the options in sections '7' and '8' to "no".
  • By now the form should be working.. Go to yourdomain.com/gbcf-v3/test-form.php to check if everything is OK.

Now we're going to add this form to one of your PivotX pages:

  • Edit the template with the head section that's used for pages. This might be something like page_template.tpl, or if you're using includes, it might be called _sub_header.tpl. Anyways, before the </head> tag, add this:

    Code: Select all
    [[ if $pagetype=="page" ]]
     <link rel="stylesheet" type="text/css" href="[[log_dir]]gbcf-v3/files/themes/gray.css" media="screen" />
    <!--[if IE]>
     <script type="text/javascript" src="[[log_dir]]gbcf-v3/files/focus.js"></script>
    <![endif]-->   
    [[ /if ]]

  • In PivotX, add a new page.. Select the right template, and place the following in the 'Introduction' field:

    Code: Select all
    [[ php ]]chdir("../gbcf-v3/");include_once("form.php");[[ /php ]]

  • View the page on your website, and verify that everyting works as it should.
And, you're done! You can see a working example of this technique here: http://webtwee.net/page/contact
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Setting up a 'Contact' form in PivotX..

Postby Stark Raving » Sat Jan 03, 2009 2:32 am

Bob,

I had placed a request in the extensions quite a while back, but this takes care of everything. Thank you.
"After I'm dead I would rather have people ask why I have no monument than why I have one." ~ Cato the Elder

"In heaven all the interesting people are missing." ~ Friedrich Nietzsche
User avatar
Stark Raving
Silver Sponsor
 
Posts: 115
Joined: Tue Dec 11, 2007 9:24 pm
Location: Vancouver

Re: Setting up a 'Contact' form in PivotX..

Postby dgerards » Tue Jan 06, 2009 9:12 pm

thx bob, I tried that and although the form seems to work fine I have one problem I hope you or someone else on this forum can help with...

http://www.tdrt.dk/?p=form

why is the form not aligned to the left or centered? I expect it's something in the .css, but I can't figure out how to correct this.

*EDIT* nevermind it's fixed... it's in the theme css file:

#form-div {
font-family : verdana, helvetica, palatino sans, tahoma, arial, sans-serif;
width : 70%;
margin : auto;
color : #555;
line-height : 1.7em;
}

thx
Dimitry
Join me and become a Contributor of PivotX!
The Danish Racing Team and DGerards.net are powered by PivotX
User avatar
dgerards
Contributor
 
Posts: 64
Joined: Tue Feb 26, 2008 9:22 pm
Location: Sao Paulo, Brazil

Re: Setting up a 'Contact' form in PivotX..

Postby Luminance Design » Fri Mar 13, 2009 2:37 pm

How would I insert this form in to the footer file? I want to have the form on every page in the footer but am having no joy at getting it to show...

I've tried the PIVOTX php include tags and standard ones in the 'default_footer.php' template but to no avail - as yet!

I've been rebuilding the index via the maintenance menu too.

Any help appreciated!

Mike
User avatar
Luminance Design
 
Posts: 4
Joined: Fri Mar 06, 2009 5:13 pm

Re: Setting up a 'Contact' form in PivotX..

Postby rabbeltje » Fri Mar 13, 2009 2:43 pm

did you allow php-includes?

set: 'allow_php_in_templates' to 1, in adanced config
User avatar
rabbeltje
 
Posts: 358
Joined: Mon Aug 25, 2008 11:54 am
Location: Neerbeek, The Netherlands

Re: Setting up a 'Contact' form in PivotX..

Postby Luminance Design » Fri Mar 13, 2009 3:02 pm

Thanks Rabbeltje!

I added that in the config and I'm now getting somewhere!

Many thanks...

Mike
User avatar
Luminance Design
 
Posts: 4
Joined: Fri Mar 06, 2009 5:13 pm

Re: Setting up a 'Contact' form in PivotX..

Postby dwaas » Fri Mar 13, 2009 8:53 pm

Luminance Design wrote:How would I insert this form in to the footer file? I want to have the form on every page in the footer but am having no joy at getting it to show...

I've tried the PIVOTX php include tags and standard ones in the 'default_footer.php' template but to no avail - as yet!

I've been rebuilding the index via the maintenance menu too.

Any help appreciated!

Mike


A simple search of the supportforum would of helped you too ( viewtopic.php?f=2&t=712 ) ;)
User avatar
dwaas
Contributor
 
Posts: 93
Joined: Mon May 19, 2008 9:11 am
Location: Maastricht, The Netherlands

Re: Setting up a 'Contact' form in PivotX..

Postby Luminance Design » Sat Mar 14, 2009 10:37 am

Thanks Dwaas,

I'm humbled by my ignorance and impatience...

Hopefully next time I need help I won't be in such a flap!

Thanks again helpers.

Mike
User avatar
Luminance Design
 
Posts: 4
Joined: Fri Mar 06, 2009 5:13 pm

Re: Setting up a 'Contact' form in PivotX..

Postby THijs » Fri Mar 20, 2009 5:56 pm

I've been driving myself mental :shock: for a few days now, so I decided to ask. I've got a working test-form. I've got the form showing in my template, the only thing is, I don't get an email from the real form, the test-form however gives me the propper emails. Looking around on the internet, the only thing I could find was something about the .htaccess (won't help me though because it's not an apache server), I think i followed all the steps involved in setting it up... The form is http://www.delftians.com/?p=registration-form here.

I'm tapped out on the possible solutions, anywhere new I can look? :roll:
It is placed in the template by the way, it doesn't show up when I place it in the introduction field.

Am I correct in assuming the mail settings are correct because the test-form works? Even the form, not just the test-form, works perfectly outside of pivotx, so it has got to be some code interfering with each other. I think it must be something with my pivotx, setup... The thing is, this is my first experience with php, so I'm not really changing any code and my pivotx setup is as good as out of the box. I've added the advanced setting to make php in templates possible but thats it.
THijs
 
Posts: 5
Joined: Fri Mar 20, 2009 5:48 pm

Re: Setting up a 'Contact' form in PivotX..

Postby Pieter » Mon Mar 23, 2009 6:59 pm

Hello Thijs,

I'm not sure if I can help you, but first of all a question: do you use PHP to set up a contact form? 'Cause the new Pivot is using a template engine, PHP won't be parsed correctly if you use it in your templates. I used php to include some files, but this lead to wrong results. I was unable to set up an in-Pivot contact form and made therefore a 'stand alone'

I'm curious... :)

Greetings,

Pieter
Webdesigner, copywriter, translator and SEO specialist at www.write-it.nl
Pieter
 
Posts: 71
Joined: Mon Mar 23, 2009 6:53 pm
Location: Elspeet

Next

Return to 2.x Discussion

Who is online

Users browsing this forum: No registered users and 2 guests