Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#97 2007-03-25 16:49:05

redcrew
Member
Registered: 2007-03-23
Posts: 16

Re: zem_contact_reborn 4.0.3.19 (old version)

I’m using Firefox 2.0.0.2 under Windows XP Service Pack 2.
Whoops! correction, it was just updated this weekend. It’s Firefox 2.0.0.3.

Last edited by redcrew (2007-03-25 16:49:52)

Offline

#98 2007-03-25 16:59:04

redcrew
Member
Registered: 2007-03-23
Posts: 16

Re: zem_contact_reborn 4.0.3.19 (old version)

Ruud,

Interesting. I just tested the contact form in Internet Explorer 6 under Windows XP. It works fine redirecting to the designated page, without the additional characters in the address bar.

Offline

#99 2007-03-25 18:07:29

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

redcrew, I’m not sure which browser displays the correct behaviour here. Looking at RFC2616 I’d say that Explorer shows the correct behaviour (we’re using a 303 redirect), although it doesn’t explicitly say that the Firefox behaviour is wrong:

The new URI is not a substitute reference for the originally requested resource.

When redirecting, the extra #anchor is used to make the browser scroll down to the part of the page that displays the form+errors+thanks. Since there’s no way for ZCR to know in advance if the form was filled out correctly, it’s not possible to leave the #anchor out when redirecting.

Last edited by ruud (2007-03-25 18:08:08)

Offline

#100 2007-03-25 18:25:16

redcrew
Member
Registered: 2007-03-23
Posts: 16

Re: zem_contact_reborn 4.0.3.19 (old version)

Ruud,

Thanks for the quick response. Perhaps I should forego my idea of redirecting to another page, and display the thanks on the contact page itself?

The reason I thought to use a different page was because that is how I’ve managed some forms in the past. Plus I couldn’t figure out how to do a conditional statment of “if form not filled out, display form/if form filled out, display thanks message” in Textpattern.

I’ve only started using Textpattern this past week, so I have a bit of a learning curve. I realize there are conditionals in Textpattern, but haven’t progressed to that level yet. In my PHP sites, I’ve used:

if (array_key_exists('send', $_POST))

where send is the value of the submit button to check what should be displayed on the page. If the form hasn’t been submitted, the form is displayed. If it was submitted, the “thanks” message was displayed.

Offline

#101 2007-03-25 19:23:21

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

I think the ‘thanks_form’ attribute in the ‘zem_contact’ tag is what you’re looking for. It enables you to put the ‘thanks message’ in a regular TXP form and it will be displayed instead of the form upon successful submission.

Offline

#102 2007-03-25 19:48:31

redcrew
Member
Registered: 2007-03-23
Posts: 16

Re: zem_contact_reborn 4.0.3.19 (old version)

Okay, but a couple more questions:

1. I created the contact page as a static page, using a static page template, and created the content for the contact page as a “sticky” article, (following these instructions). The “sticky” article contains some text along with the code for the contact form.

I’ve created Textpattern forms for header, footer, and other content as type “misc”.

I can create a Textpattern form named “thanks”, containing the “thanks” message text, but I’m not sure what type of form it is. I’m assuming, though I’m not sure, that the type is “article”, is that correct? I read the explanation of article form:

An article form is used by the <txp:article /> tag to determine how to display each article on the page, for example.

but I’m a bit confused on the semantics. I’m creating a form for the “thanks” message, not an article.

2. In order to use the “thanks” form, should I move all the existing content that is currently in the contact “sticky” article to a Textpattern form named “contact”?
And then use some type of Textpattern conditional (which I haven’t discovered yet) to display either the “contact” info or the “thanks” message?

Last edited by redcrew (2007-03-25 19:52:39)

Offline

#103 2007-03-25 19:54:57

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

I don’t know if the form type is checked anywhere in TXP, but for this purpose ‘misc’ fits best because it’s used as a code snippet, not as a template for an article.

The parts that you want to show only when the contact form is displayed should be inside the <txp:zem_contact> … </txp:zem_contact> container. Parts of the page you want to show regardless of whether the form is displayed or the thanks message, should be outside that zem_contact container. The content of the thanks_form is displayed instead of what’s inside the zem_contact container when the form is successfully submitted (that’s the condition, so no separate conditional is needed).

Offline

#104 2007-03-25 20:28:36

redcrew
Member
Registered: 2007-03-23
Posts: 16

Re: zem_contact_reborn 4.0.3.19 (old version)

Ruud,

Thanks again for such a quick reply.

I believe moving the text inside the zem_contact form will create usability issues, since

  1. there are several paragraphs of text before the form is presented.
  2. error messages in the form would precede the paragraphs of text and would not be in close proximity of the form itself

Did I misunderstand the location the error messages would display?

Offline

#105 2007-03-25 20:51:59

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

You understood correctly. I think the ‘redirect’ solution fits best in your situation. You can probably combine that with the conditional approach you mentioned in post #100 by redirecting to the same page that hosts the form with ?thanks (or something like that) appended to the URL and using the query string to trigger the conditional.

Last edited by ruud (2007-03-25 20:53:41)

Offline

#106 2007-03-26 20:01:57

sugoo
Member
Registered: 2006-05-29
Posts: 20

Re: zem_contact_reborn 4.0.3.19 (old version)

Can zem_contact to=”“ specify more than one e-mail address? If so, would I simply separate the addresses with commas? Thanks!

Offline

#107 2007-03-26 20:27:34

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

Is it possible on zem_contact_select to offset the first item in the list so that the user still needs to select something. Similar to how the empty functionality list=",item1,item2" ignores the first empty item and requires the user to select an item.

I often use something like ‘Please Select…’ as the first item and would like to still require the user to select a different item.

Offline

#108 2007-03-26 20:38:37

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.19 (old version)

tinyfly, that’s not something ZCR can do, although you could alter it after page loading using some javascript.

sugoo, the to attribute does indeed take a comma-separated list of email addresses.

Last edited by ruud (2007-03-26 21:24:09)

Offline

Board footer

Powered by FluxBB