Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2016-02-15 10:52:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

giz wrote #297789:

the form works every time, as long as I exclude the <txp:zem_contact_email /> field.

How very strange. Is there any change if you try any of the following:

  • <txp:zem_contact_email name="email" />
  • <txp:zem_contact_text type="email" name="email" />
  • <txp:zem_contact_text name="email" />

If any of those work, I wonder if it’s missing a gTxt() string. See, if you don’t specify a name attribute (which the zem_contact_email tag doesn’t by default) it tries to use the label as the name. The label defaults to gTxt('zem_contact_email') so if that string is missing form your txp_lang database table, there’ll be no name set in the HTML for that field, which will thus have no sender, which might cause some filters to drop the message or trip Txp’s sendmail feature into a spin. When you render the form, is there a name for the email field when you use <txp:zem_contact_email />?

If this problem is the case I’ll have to put some defensive code in to trap conditions where there’s no name attribute set.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#14 2016-02-15 17:48:47

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,640
GitHub Twitter

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #297868:

Good catch, thanks. The new boolean attributes probably shouldn’t have any value at all if you are using HTML 5. Not sure how best to implement that, but I’ll see what I can do.

Hi Stef ;)

Don’t worry about that: it’s not very important.

Another feature which could be more important for your final release: the ability to support translations for fallback error messages. May be with a trad="en" or lang="fr" attribute for the <txp:zem_contact > tag.

    zem_contact_field_missing: Your Name
    zem_contact_field_missing: Email
    zem_contact_field_missing: Message

I make lot of multi-language websites and I could send you a donation for that ;)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#15 2016-02-15 18:14:44

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 304
Website GitHub Twitter

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Thanks, Stef.

Bloke wrote #297870:

When you render the form, is there a name for the email field when you use <txp:zem_contact_email />?

The name and id field are set to ‘Email’.

I solved the problem by converting zen_contact to use SMTP mail.

Offline

#16 2016-02-18 21:42:57

qrayg
Member
From: USA
Registered: 2004-08-27
Posts: 81
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

I can’t seem to get placeholder to work. Is there some special attribute you need to set or something?

<txp:zem_contact_text label="Name" class="" placeholder="First Last" />

Does not render the placeholder attribute on the frontend.

Offline

#17 2016-02-19 10:47:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

qrayg wrote #297910:

I can’t seem to get placeholder to work. Is there some special attribute you need to set or something?

Nope, but make sure your Doctype in Admin->Preferences is set to render HTML 5. Without that, all HTML5esque elements are ignored.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#18 2016-02-19 13:07:50

qrayg
Member
From: USA
Registered: 2004-08-27
Posts: 81
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #297918:

Nope, but make sure your Doctype in Admin->Preferences is set to render HTML 5.

Ahhh… Thank you, that did the trick.

Awesome job on the new zem_contact_reborn plugin. With how it’s changed over the years it should really be renamed and stripped of the zemCamelCase classes.

Offline

#19 2016-02-19 13:19:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

qrayg wrote #297923:

it should really be renamed and stripped of the zemCamelCase classes.

Yeah, but I decided to keep it as close to the original for backwards compatibility, otherwise people would have to rewrite their forms / style rules.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#20 2016-02-19 13:57:32

qrayg
Member
From: USA
Registered: 2004-08-27
Posts: 81
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #297924:

Otherwise people would have to rewrite their forms / style rules.

As someone who maintains dozens of TXP sites with massive contact, quote, and application forms using this plugin… I’m totally ok with redoing my forms and removing all the .zem classes from my stylesheets. I’d rather be able to fully control the markup so I can use frameworks like Bootstrap or Skeleton to rapidly build forms instead of having to deal with the .zem stuff and writing jQuery to swap them out for proper consistent classes.

Offline

#21 2016-02-19 16:53:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

qrayg wrote #297926:

I’m totally ok with redoing my forms and removing all the .zem classes from my stylesheets. I’d rather be able to fully control the markup

No problem. Here’s a step towards that nirvana. You can now customise the error/info class names via the classes attribute on the <txp:zem_contact /> tag. They default to the camelCase class names of yesteryear so nobody’ll be any wiser unless they start tinkering with the attribute. See the docs for details.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#22 2016-02-19 17:11:07

qrayg
Member
From: USA
Registered: 2004-08-27
Posts: 81
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #297929:

Here’s a step towards that nirvana.

Awesome! Can’t wait. Thanks so much.

Offline

#23 2016-02-19 22:16:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Pat64 wrote #297828:

W3C validator error found: Bad value for autofocus="1"

This should be fixed from this point on as the plugin now correctly renders boolean attributes as single words. Please test if you can.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#24 2016-02-19 22:25:44

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Pat64 wrote #297874:

the ability to support translations for fallback error messages. May be with a trad="en" or lang="fr" attribute for the <txp:zem_contact > tag.

Sorry, I’m not quite sure I follow this. Do you have an example of a workflow where you can explain what you expect the outcome to be under various circumstances? The plugin supports the lang attribute everywhere for individual fields and error messages are in Textpacks, but if the attributes can be made more useful or work better with languages then let me know how you think it should work and I’ll see what I can do.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

Board footer

Powered by FluxBB