Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2016-04-09 14:54:20

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #298556:

Yes, it does something very similar to the way core does it by reading the value of smtp_from and using it, if set. So hopefully this version will work for you. Please try it and let me know either way. If it doesn’t work, I’ll help you figure out how to set it up so it does, and fix the plugin to allow you to set headers the same as core so messages get through.

Thanks for the offer to help, Stef. The need is less pressing now. I figured out how to fix the PEAR::Mail script that converts a mildly bodged ZCR’s output to SMTP mail capable of getting through Rackspace Sites’ strictures. Rackspace isn’t the only Host to set up these PHP Mail strictures. Every now and then over the last decade plus I have pointed desperate folks who host with one of these companies to that workaround.

I setup a vanilla TXP 4.5.7 site with a copy of ZCR 4.5.0.0 yesterday. It has a valid SMTP envelope sender address applied in Advanced Preferences. It may not be the latest version of 4.5.0.0 but it is otherwise pristine and not bodged. The site spits out installation and password management emails that get through no problem but ZCR output doesn’t. I am pretty sure that this installation would perform the same way on sites with Hosts that apply the same strictures, I detected the same kind of cries for help in this thread as I looked through it earlier.

I will send you a publisher login for the site (matras*******.com) I set it up just for this so you could test via Rackspace. Feel free to do the necessary or anything else. It would be great to be able to use aligned TXP and ZCR straight out of the box!!!

Last edited by joebaich (2016-04-09 15:11:20)

Offline

#38 2016-04-25 06:58:30

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,078
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

I have ( I think) the same issue as Pat64 with missing/error message strings in different languages.

I have a small bilingual site, admin interface uses english as language. Owner want two contact forms: one in English (OK, no problems) and one in Japanese. No problems to have the labels /placeholders for the various fields working in Japanese; I can (I think, haven’t actually implemented it yet) present a custom thanks message (via thanks="text") / send email in Japanese. However, how do I get error messages or zem_contact_field_missing to display in Japanese for the Japanese form?


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#39 2016-04-25 07:37:02

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

phiw13 wrote #298802:

However, how do I get error messages or zem_contact_field_missing to display in Japanese for the Japanese form?

+1 (NL/EN)

Offline

#40 2016-04-25 08:28:28

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,078
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

One or two ideas (just rough sketches actually) how this problem with different language strings could be improved:

  1. add a error_message="text string" attribute for each (required) form field
  2. add a error_form="form name" attribute to the <txp:zem_contact /> tag (something similar to the existing body_form="form name" attribute, with probably a similar formatting for that TXP-form).

Both override the default message(s).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#41 2016-04-25 08:46:15

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

phiw13 wrote #298802:

I have a small bilingual site

How is it set up? MLP or just with separate Sections for each language?

I think I need to figure this out once and for all so if you could give me a little detail about how your site is set up — example contact form(s) and general layout of the site Sections and Pages — I’ll try and replicate it on my test site and see if I can work out a solution.

P.S. Did this feature work in the previous version of ZCR?

Last edited by Bloke (2016-04-25 08:46:58)


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

Offline

#42 2016-04-25 09:34:35

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,078
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #298805:

@bloke:

Ok – there are actually bilingual pages, part English, part Japanese, then there are sections with either Japanese or English content. But that does not matter much.

There is a contact section, example.com/contact/ returns a list of links to the actual contact pages
/contact/contact-en
/contact/contact-ja

Both are basic individual article pages with a blurp of text followed by the (really basic atm, really could be straight copy paste from the plugin help file) contact form called by <txp:zem_contact /> (inside a TXP article form):

<article id="art-n<txp:article_id />"><header><h1 ><txp:title /></h1></header>

<section class="article-body"><txp:body /></section>
<section>
<txp:zem_contact classes="element:warn-field, required:required-field, thanks:thanks-message, wrapper: error-message" to="recipient@example.com" form="ja_contact" class="contact-form-form" thanks="XXX" />
</section>
</article>

The ja_contact form fields (placeholder in English for your pleasure):

<ol>
<li><txp:zem_contact_email break="" label="E-mail" placeholder="Your email address" /></li>
<li><txp:zem_contact_text break="" label="お名前" placeholder="Your Name" /></li>
<li><txp:zem_contact_text break="" label="TEL" type="tel" min="7" max="15" placeholder="Telephone number" /></li>
<li><txp:zem_contact_text break="" label="URL" min="7" type="URL" placeholder="Your URL (optional)" required="0" /></li>
</ol>
<p class="contact-message"><txp:zem_contact_textarea break="" label="Your message" /></p>
<p>Please note that fields marked with <span class="required">*</span> are required</p>
<p class="submitfield"><txp:zem_contact_submit label=" 送 信 " /></p>

The english language form is the same structure etc.

All the above works OK, so far. The user fills in the form, makes a poo-poo, gets a message – in English (because the admin runs in English) – the erroneous fields are highlighted etc. I would want to display the message in Japanese in that case (only for the Japanese form of course).

P.S. Did this feature work in the previous version of ZCR?

Dunno, haven’t use ZCR in a similar context before.

it is really no hard to understand: I have a form in English, another form in Japanese, all I ask is the ability to display error messages in Japanese (for the JPN form) when the user does something wrong (and the browsers build in validation doesn’t work is override, whatever). I think that is exactly the same what Pat 64 asked previously.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#43 2016-04-25 09:56:33

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

phiw13 wrote #298807:

I would want to display the message in Japanese in that case (only for the Japanese form of course).

Thanks for the detail. I can set that up on my site easily enough.

it is really no hard to understand: I have a form in English, another form in Japanese, all I ask is the ability to display error messages in Japanese (for the JPN form)

Yep, I get that. The only trouble with your proposed solutions is that they only cater for one type of error message. There are many things that can go wrong: all possibilities of which are defined in the Textpacks. The trouble is that the choice of Textpack is based on the admin-side language in use.

What we really need is a way to signal to ZCR that the contact form in question is in some other language that should override the admin-side language. The obvious way to do that might be to specify a lang attribute to the zem_contact tag. Not sure if that conflicts with HTML’s global lang attribute though, so I’d need to check. If it clashes, maybe language would be acceptable.

Assuming something like that is viable, the trick then is to find a way to signal to Txp that all gTxt() calls should be in the given target language instead of what it usually deems as the one to use. I’ll play around and 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

Offline

#44 2016-04-25 12:17:16

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,078
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #298808:

Yep, I get that.

Good now we’re talking :-).

The only trouble with your proposed solutions is that they only cater for one type of error message. There are many things that can go wrong: all possibilities of which are defined in the Textpacks. The trouble is that the choice of Textpack is based on the admin-side language in use.

That is why a qualified my idea as very rough sketch. Just thinking out loud. I’m aware that many more things can go wrong than an invalid field.

And indeed. the ”trouble” is that Textpacks are tied to the admin language.

What we really need is a way to signal to ZCR that the contact form in question is in some other language that should override the admin-side language. The obvious way to do that might be to specify a lang attribute to the zem_contact tag. Not sure if that conflicts with HTML’s global lang attribute though, so I’d need to check. If it clashes, maybe language would be acceptable.

Does it need to be public facing? If it is only used internally – as in: it is not outputted in the HTML, it doesn’t really matter. Or maybe call it something like a txp-language attribute. [I’m thinking perhaps it is a mechanism that could, it in the long run, find other uses for a truly multilingual Texpattern].


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#45 2016-04-25 13:07:40

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

phiw13 wrote #298814:

Does it need to be public facing?

If it could automatically figure out the language, that’d be awesome. You’ve used suffix -ja but sadly not everyone will do the same. For a core-sanctioned multi-lingual experience in some future Txp version, a convention would be adopted that signals the language.

If it is only used internally – as in: it is not outputted in the HTML, it doesn’t really matter.

True. Just didn’t want to add unnecessary confusion.


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

Offline

#46 2016-04-26 19:55:10

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

For anybody wanting to try out local language messages, please give beta 3 a spin.

Add a lang attribute to your <txp:zem_contact /> tag with the full Textpack language code (e.g. lang="es-es") and it’ll pull in the Textpack for that language, overriding the one that is in use by the admin side. The Textpack for that language must, of course, be installed or otherwise defined in the database.

Please report any issues you may find as usual and I’ll squash ‘em.


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

Offline

#47 2016-04-27 01:05:46

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,078
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #298838:

For anybody wanting to try out local language messages, please give beta 3 a spin.

Thanks for the quick work on this! I’ll try to play with this later today.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#48 2016-04-28 01:54:09

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,078
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #298838:

For anybody wanting to try out local language messages, please give beta 3 a spin.

So far, that does the deed. Errors and missing fields are correctly reported in French and Spanish (with Admin language in English). Cool. Thank you.

Now I have to get that stuff translated in Japanese (I’m not good enough to do it myself). I’ll send that over when ready.

PS. You have a typo in the help file. Quote from the file:

… e.g. lang="fr=fr" would load the French language strings…

I was lazy as always and blindly copy pasted that into my TXP form. Surprise… didn’t work as expected. Took me a full 5 seconds of staring at the screen to see it. In case you don’t see it, it should be lang="fr-fr".


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB