Page 1 of 3

Setting up a 'Contact' form in PivotX..

PostPosted: Wed Oct 08, 2008 4:40 pm
by Bob
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

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

PostPosted: Sat Jan 03, 2009 2:32 am
by Stark Raving
Bob,

I had placed a request in the extensions quite a while back, but this takes care of everything. Thank you.

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

PostPosted: Tue Jan 06, 2009 9:12 pm
by dgerards
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

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

PostPosted: Fri Mar 13, 2009 2:37 pm
by Luminance Design
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

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

PostPosted: Fri Mar 13, 2009 2:43 pm
by rabbeltje
did you allow php-includes?

set: 'allow_php_in_templates' to 1, in adanced config

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

PostPosted: Fri Mar 13, 2009 3:02 pm
by Luminance Design
Thanks Rabbeltje!

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

Many thanks...

Mike

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

PostPosted: Fri Mar 13, 2009 8:53 pm
by dwaas
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 ) ;)

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

PostPosted: Sat Mar 14, 2009 10:37 am
by Luminance Design
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

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

PostPosted: Fri Mar 20, 2009 5:56 pm
by THijs
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.

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

PostPosted: Mon Mar 23, 2009 6:59 pm
by Pieter
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