Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#253 2020-08-09 09:43:49

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

Re: com_connect - form and contact mailer

Bloke wrote #325259:

Patched.

How backwards compatible is this, for people still using TXP4.7 ?


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

Offline

#254 2020-08-09 11:49:20

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: com_connect - form and contact mailer

phiw13 wrote #325260:

How backwards compatible is this, for people still using TXP4.7 ?

Yes, it should work in 4.6+.

Offline

#255 2020-08-09 11:59:38

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

Re: com_connect - form and contact mailer

It is 4.7+ only. The lang strings are designed for the 4.7 shorter langs identifiers.


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

#256 2020-08-09 12:05:17

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

Re: com_connect - form and contact mailer

etc wrote #325267:

Yes, it should work in 4.6+.

Bloke wrote #325268:

It is 4.7+ only. The lang strings are designed for the 4.7 shorter langs identifiers.

selfishly, 4.7+ is OK !
Thank you both.

(we really should start looking at upgrading that site to 4.8.x)


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

Offline

#257 2020-12-18 04:28:48

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

Re: com_connect - form and contact mailer

Where can I download the textpack for Dutch (nl-nl)? If there is one … :o

If not … how can I change the error text (“This form has already …”) into Dutch?

Last edited by RedFox (2020-12-18 04:29:05)

Offline

#258 2020-12-18 10:08:53

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

Re: com_connect - form and contact mailer

RedFox wrote #327588:

Where can I download the textpack for Dutch (nl-nl)? If there is one … :o

It’s in the plugin already and should auto-apply it when Dutch is installed in your Txp. However, that largely depends on when you installed it and into which version of Textpattern.

The language designators in the plugin are still the ‘old’ 4.6-style ones, but they should gracefully fall back to the new designators. At least I hope that happens. In theory, if you install the plugin on a 4.8+ Textpattern, it’ll store all the packs in the database ready for you so when you add/switch languages they’ll auto-install.

If for some reason the pack hasn’t worked, try this pack that I copied directly from near the top of the plugin code:

#@public
#@language nl-nl
com_connect_checkbox => Keuze
com_connect_contact => Contact
com_connect_email => E-mail adres
com_connect_email_subject => {site} > bericht via de site
com_connect_email_thanks => Hartelijk dank, je bericht is verzonden.
com_connect_field_missing => Je hebt bij <strong>{field}</strong> nog niets ingevuld.
com_connect_format_warning => De invoer {value} in <strong>{field}</strong> heeft niet de juiste vorm.
com_connect_form_expired => Het formulier is verlopen, probeer het opnieuw.
com_connect_form_used => Het formulier is reeds verstuurd, vul het opnieuw in.
com_connect_general_inquiry => Bericht van de site
com_connect_invalid_email => <strong>{email}</strong> is geen geldig e-mail addres.
com_connect_invalid_host => <strong>{host}</strong> is geen geldige e-mail host.
com_connect_invalid_utf8 => <strong>{field}</strong> bevat ongeldige lettertekens.
com_connect_invalid_value => Ongeldige invoer bij <strong>{field}</strong>, <strong>{value}</strong> is niet mogelijk.
com_connect_mail_sorry => Sorry, er kan geen e-mail verzonden worden.
com_connect_maxval_warning => <strong>{field}</strong> mag niet groter zijn dan {value}.
com_connect_max_warning => <strong>{field}</strong> mag niet meer dan {value} lettertekes bevatten.
com_connect_message => Berichttekst
com_connect_minval_warning => <strong>{field}</strong> moet minstens {value} zijn.
com_connect_min_warning => <strong>{field}</strong> moet minstens {value} lettertekens bevatten.
com_connect_name => Naam
com_connect_option => Optie
com_connect_pattern_warning => <strong>{field}</strong> komt niet overeen met de volgorde {value}.
com_connect_radio => Keuzeknop
com_connect_recipient => Ontvanger
com_connect_refresh => Je kunt deze link gebruiken als de pagina niet automatisch ververst.
com_connect_secret => Geheim
com_connect_send => Verzenden
com_connect_send_article => Artikel verzenden
com_connect_spam => We accepteren geen spam!
com_connect_text => Tekst
com_connect_to_missing => <strong>Aan</strong> e-mailadres ontbreekt.

Copy and paste that into the ‘Install from Textpack’ box at the bottom of the Admin>Languages panel and you should be good to go.


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

#259 2020-12-18 12:58:49

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

Re: com_connect - form and contact mailer

For the very first time I consciously set the correct languages in the language tab of Textpattern. Boy, am I lazy … :o

With “lang=“nl-nl” in the com_connect tag everything works like a charm. As you stated.

Thanks Bloke … :)

Offline

#260 2021-01-17 18:55:46

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: com_connect - form and contact mailer

Yiannis asked here if perhaps body_form and permlink might be used to get the URL of the page on which the user submitted the contact form. I’ve tried it and tried permlink inside com_connect_secret too but it seems txp:tags aren’t allowed inside com_connect?

I don’t need this now, but it does seem like a good idea if txp:tags could be used somewhere inside the form.


BB6 Band My band
Gud One My blog

Offline

#261 2021-01-17 20:36:28

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

Re: com_connect - form and contact mailer

zero wrote #328203:

I’ve tried permlink inside com_connect_secret too but it seems txp:tags aren’t allowed inside com_connect?

They are but you may need to think about context. If you’re displaying an article then with your form on it, then including this in your form will send the permlink along:

<com::connect_secret label="This article"><txp:permlink /></com::connect_secret>

(in theory, you could use value='<txp:permlink />' if you prefer).

But if you’re on a landing page or something like that then <txp:permlink /> won’t work and you’ll need to use <txp:page_url /> instead to get at the URL component you want to submit.


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

#262 2021-01-17 21:44:42

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: com_connect - form and contact mailer

Thanks Stef. I tried it and it works. I’ll have to look into ::!


BB6 Band My band
Gud One My blog

Offline

#263 2021-01-17 22:30:06

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

Re: com_connect - form and contact mailer

zero wrote #328205:

I tried it and it works. I’ll have to look into ::!

Excellent. The double-colon is just shorthand notation for plugins so instead of:

<txp:com_connect_text />
<txp:smd_if />

You can shorten them to:

<com::connect_text />
<smd::if />

Note: plugin tags that take <txp:else /> can actually use the plugin prefix and double-colon as well if you wish to make it more obvious which ‘else’ is associated with which tag. A contrived example:

<txp:if_section name="">
   <txp:if_category>
      <txp:category wraptag="h3" title />
      <txp:article limit="5" />
   <txp:else />
      <smd::if field="urlvar:product_code" operator="isalnum">
         <txp:output_form form="show_product" />
      <smd::else />
         <p>Invalid product code</p>
      </smd::if>
   </txp:if_catgeory>
<txp:else />
   Other section page handling here...
</txp:if_section>

(and in fact <txp:output_form form="show_product" /> can be shortened using shortcode syntax to: <txp::show_product /> – only works if your shortcode form names use ASCII and underscores though. Won’t work with hyphens)

Last edited by Bloke (2021-01-17 22:34:01)


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

#264 2021-01-18 09:22:24

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: com_connect - form and contact mailer

Thanks for going beyond the call of duty with your explanation, Stef. Much obliged. If I don’t use it, I lose it, and probably read about double-colons before, but I hope this time it will stick.

My previous failed attempt probably had a syntax error, because it works just fine now:

<txp:com_connect_secret label="Sent from"><txp:site_url trim="/" /><txp:page_url /></txp:com_connect_secret>

But

<com::connect_secret ><txp:site_url trim="/" /><txp:page_url /></com::connect_secret> 

is very neat and your else and output_form examples are very useful too. Thanks!


BB6 Band My band
Gud One My blog

Offline

Board footer

Powered by FluxBB