Announcement

Collapse
No announcement yet.

Multiple 'contact us' pages?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multiple 'contact us' pages?

    Hello,
    I was wondering if it is possible to have more than one 'contact us' page? We have a requirement for a few distinct contact us forms with different questions on each (although they will all come to the same email address).

    Which leads me on to the question - it is possible to have user defined fields on the standard contact us page?

    Thanks,
    Jan
    Jan
    www.littleherbal-international.com

    #2
    i would look to using nmsformail for the extra contact forms.

    http://nms-cgi.sourceforge.net/scripts.shtml

    Comment


      #3
      Thanks Jo. Have since had a discussion with the boss as to requirements.

      We would probably be able to make do with a single 'contact us' page but would need more fields to capture specific enquiry date. Is it possible to do this?

      I've had a look at the help that comes with the app and see the variable reference guide for this page. Doesn't look as if I can, unless I'm missing something...
      Jan
      www.littleherbal-international.com

      Comment


        #4
        This knowledgebase article might be what you are after: How can I add extra fields into the 'Contact Us' email form (v8 and above)?
        Last edited by KB2; 22-Mar-2010, 01:05 PM. Reason: Updating kb links
        Darren Guppy
        Golf Tee Warehouse
        Golf Tees and Golf Accessories.

        Comment


          #5
          i used a simple php based contact us form when i was looking for interest in a new product.

          Basically i created a custom fragment and put the code in that, it worked a treat and allows you to create as many as you need, just tweak the code of each one

          Comment


            #6
            Thanks all - that KB article's just the ticket!
            Jan
            www.littleherbal-international.com

            Comment


              #7
              I have a better way of doing this that doesn't need you to edit field names into the Perl in several places.

              The Perl code detects any number of additional fields and whether they're to be mandatory or optional from the Contact Us form data.

              Thus only the Contact Us form code needs tweaking to suit the user requirements. Indeed the code will do nothing if you have no additional fields so it could become part of standard Actinic functionality.

              INSTALLATION

              Edit MailForm.pl (in Site1 - back it up first just in case) and look for the lines
              Code:
              	if ($sMessage eq "")
              		{
              		$sError .= ACTINIC::GetRequiredMessage(-1, 2373);
              		}
              append the following immediately below these lines
              Code:
              # START Additional Custom Fields
                              my $sItem;
              		foreach $sItem (keys %::g_InputHash)	# now see if any empty mandatory custom fields (beginning with "M$")
              			{
                                      if ( $sItem =~ /^M\$(.*)/ )
              				{
              				if ( $::g_InputHash{$sItem} eq '' )
              					{
              					$sError .= "<b>\"" . $1 . ":\"</b> is required<br>"
              					}
              				}
              			}
              # END Additional Custom Fields
              look for the line
              Code:
              		$sTextMailBody .= ACTINIC::GetPhrase(-1, 2373) . "\r\n" . $sMessage . "\r\n\r\n";
              append the following immediately below
              Code:
              # START Additional Custom Fields
                              my $sItem;
              		foreach $sItem (keys %::g_InputHash)	# now see if any additional custom fields beginning with "O$" or "M$"
              			{
                                      if ( $sItem =~ /^[O|M]\$(.*)/ )
              				{
              				$sTextMailBody .= "\r\n" . $1 . ": " . $::g_InputHash{$sItem};
              				}
              			}
              		$sTextMailBody .= "\r\n\r\n";
              # END Additional Custom Fields
              That's MailForm.pl patched.


              Edit layout Contact Us Bulk Area and add lines as appropriate.
              Here's an example of one optional and one mandatory field:-

              Code:
              <!-- START - SAMPLE ADDITIONAL FIELDS -->
                <tr> 
                  <td>&nbsp;</td>
                  <td>Optional Field:</td>
                  <td> <input type="TEXT" name="O$Optional" size="50" maxsize="125" value=""></td>
                </tr>
              
                <tr> 
                  <td>&nbsp;</td>
                  <td><span class="actrequired">Mandatory Field:*</span></td>
                  <td> <input type="TEXT" name="M$Mandatory" size="50" maxsize="125" value=""></td>
                </tr>
              <!-- END - SAMPLE ADDITIONAL FIELDS -->
              NOTES

              Form field names must start with either O$ (optional) or M$ (mandatory).
              Use single words for the field names. All names must be unique.
              The part of the field name after the "$" is used as the heading in the generated mail
              and in any error messages (due to empty mandatory fields).
              You can have a longer description for the field title, but this only appears on the
              form and isn't used in the email.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                That codes works a treat - very useful, thanks for posting it Norman.

                I would like to have multiple contact pages, and have been playing around with using a duplicate contact form in a brochure fragment layout.

                It works fine unless there are any errors, in which case you are bounced back to the original 'contact us' page - obviously that is no good. Any ideas how to change this, and is it possible without lots of script changes (which is beyond my limited comprehension)?

                I thought that it might be possible to duplicate and rename the mailform.pl as many times as necessary for different forms, but then realised there are other perl scripts involved...

                but I think this is something the community would be interested in, and tbh sounds like a feature for inclusion in a future release.

                Comment


                  #9
                  You can use multiple copies of the MailForm.pl file and edit as required to add extra form fields, etc. But you also need to duplicate the html page template that it uses. Look for this line in the perl script:
                  Code:
                  my @Response = ACTINIC::TemplateFile(ACTINIC::GetPath() . "mail_form.html", \%VarTable);
                  You can copy, rename and edit "mail_form.html" and put the new name into this line in your copied perl scripts. Then upload both files to your website using ftp.
                  ActiveStock
                  On-line, real-time stock control plug-in for Actinic V7, V8 and V9
                  **New - Captcha plug-in for your Contact Us form**

                  ActiveStock website
                  Free 30 Day Trial
                  ActiveStock Blog (including a new tutorial on a 'Sort By' function for long section pages)

                  Comment


                    #10
                    Got it!

                    Excellent - done it, thanks to your help. Here's what is involved in case anyone else wants to do it:
                    1. In your layout library, duplicate and rename the "Contact Us Bulk Area" - create as many new layouts as you need.
                    2. Create new layout selectors for each of the new contact us layouts created in stage 1.
                    3. Create new brochure pages for each form as required. Insert the new layout selector into a fragment - this will be dependent on your site design and I can't really advise the best way to do this. I just dropped the layout into the text box on the general tab and selected "Text only" as the layout (which I think is a standard Actinic layout).
                    4. Edit "Mailform.pl" as per Norman's instructions (above)
                    5. Edit the new contact layouts to include any new fields you require (following Norman's instructions)
                    6. Duplicate "mf000001.pl" and "MailForm.pl" (you need one copy of each for each new layout) and rename them (e.g. "mf0000002.pl" / "MailForm2.pl")
                    7. Now you need to change two things - the "action" called in the layout, and the page referenced in the .pl pages, to make the pages refer to eachother. So in the layout search for
                      Code:
                      <form method="post" action="<Actinic:Variable Name="SendMailPageURL"/>">
                      and replace the actinic variable "SendMailPageURL" with e.g "http://www.yoursite.com/cgi-bin/mf0000002.pl"
                    8. Then in "mf0000002.pl" and "MailForm2.html" search for
                      Code:
                      my @Response = ACTINIC::TemplateFile(ACTINIC::GetPath() . "mail_form.html", \%VarTable);
                      and replace "mail_form.html" with the pagename of your new contact form, as specified on the "Page Settings" tab of the brochure page you have dropped the new layout into.
                    9. Add your new .pl files to "Additional Files" under "Design" (not sure this is necessary, but I did it first time just to be sure) and upload
                    10. Test


                    I hope that helps someone else - thanks to Norman and Richard for their earlier posts.

                    P.S. Don't forget to check the mf0000002.pl and mailform.html pages after an upgrade - going from v9.0.4 to v9.0.5 made changes to mf0000001.pl (which weren't replicated in mf0000002.pl etc. as they are not core actinic files), which although not stopping the page from working throws up server errors for users. Copying the original over to the new files and making the above edits solves the problem.

                    Comment


                      #11
                      Does anyone know if there is a way to specify the order that the responses appear in the email?

                      It seems pretty random at the moment.

                      Comment


                        #12
                        I have just implemented this, but I had to put Norman's code into mf00002.pl as well as into MailForm2.pl.

                        However, when a user fills out the form but does not complete a mandatory field, the error message shows but the whole form is wiped clean. So the user then has to complete the whole form again.

                        Is there any way to keep any text already typed in place when error messages show up?

                        Comment


                          #13
                          Form design in Actinic v10

                          Norman. Thanks again for this very useful post. I'm new to Actinic, but was able to work through the instructions - correctly I hope
                          I have applied them, together with Alex #10 post and, on the page, the form looks as expected.
                          However, when I "Send", error panel arises, requiring Name, Subject, Email address and Message (i.e. the same as if sending the "contact us" email).
                          Where am I going wrong?
                          t.i.a.
                          Mike Warnock
                          Right Hand Man - adding extra dimension
                          Attached Files

                          Comment


                            #14
                            Omitted to attach my form text. Would you please cast your expert eye over it and let me know if I've done something incorrect?
                            t.i.a.
                            Mike
                            Attached Files

                            Comment


                              #15
                              Welcome, Mike

                              Having said that it's not really good manners to expect someone in particular to respond to you on demand. This is a volunteer Forum and I cannot be expected to directly support posts I made 2 years ago.

                              From what you've posted it looks like you're trying to put this code into a Product or Fragment description. I've no idea if that will work. My code was intended for the standard Contact Us form. Best get that working exactly as per my post #7 before tinkering with it.

                              I've no idea if post 10 is the right way to go or not.
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X