Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2018-04-06 16:25:21

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,745
Website

Re: com_connect - form and contact mailer

That’s awesome research, Julian! You will make somebody happy, I’m sure. ;) I don’t use MAMP, however. I’ve always preferred the native tools, as much as possible. Sometimes I have to bump up php with Homebrew, so it’s really a game of half/half between Mac native and Homebrew things.

But, I have a different question. I’m using the contact form on a one-page website. I want to be able to use an anchor to link to the form from top of page, externally, or wherever. I’d rather not have to put a div around the form to add the id="" when either the form, fieldset, or legend elements would do just fine. There’s a class="comConnectForm" on the form element, but it needs to be an id for an anchor, doesn’t it? Is there a way with Txp or plugin tag magic?

Maybe Stef will throw one in to make things easier ;)

Offline

#50 2018-04-06 16:35:38

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,745
Website

Re: com_connect - form and contact mailer

jakob wrote #310661:

Just leave them out or use break="" to suppress the br.

I must have missed that in the docs.

Where does it go, exactly? Once in the form tag or individually in each child tag? I’ll probably skip it because it looks okay now, but just curious.

Offline

#51 2018-04-06 16:49:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,286
Website GitHub

Re: com_connect - form and contact mailer

Destry wrote #310705:

I want to be able to use an anchor to link to the form

Unfortunately in this case, the form is given a random ID when you submit, so that it can automatically jump down to it and show the Thanks message (or highlight any errors that need fixing prior to submission). To add your own ID would kill that, hence the plugin doesn’t have that option.

I think an HTML wrapper tag is the only alternative unfortunately.

Destry wrote #310706:

Where does [the break tag] go, exactly?

It goes on each child element. There are shortcuts for the required and class attributes that can be added to the main <txp:com_connect> container and will be automatically passed to child tags (unless overridden on a tag-by-tag basis), but that doesn’t currently apply to break.

I thought about implementing it, but then the whole thing about break becoming a global attribute happened so I wasn’t sure if it was the best idea to hijack that in the plugin. Now that global attributes are a reality, this plugin probably needs to be tweaked to take advantage of them in a more consistent manner. Not sure how best to do that right now.


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

#52 2018-04-06 17:34:47

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,745
Website

Re: com_connect - form and contact mailer

Thanks, brother.

Last thing, I think. Just a wording suggestion, really…

Maybe it’s just me, but on the confirmation messages, instead of…

Thank you, your message has been sent.

How about just…

Your message was sent successfully.

If somebody sends me spam, or a rant (it happens), I sure as hell don’t want to thank them for it. ;) Saying “thank you” is kind of irrelevant, like saying “Welcome” on a home page. It’s generally pointless.

And instead of…

The form was already submitted, please fill out a new form.

The form isn’t submitted, the message is. Shouldn’t it be something like…

Message was already sent. Fill out form again to send a new message.

Offline

#53 2018-04-06 17:46:13

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,615
Website GitHub Twitter

Re: com_connect - form and contact mailer

Hi Destry,

You can edit the confirmation message by using the thanks attribute:

<txp:com_connect to="e@domain.tld" label=""  thanks="Your message was sent successfully.">

Regarding your second point… I could not see any way to do it without hacking the plugin.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#54 2018-04-06 19:00:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,136
Website

Re: com_connect - form and contact mailer

Destry wrote #310705:

That’s awesome research, Julian! You will make somebody happy, I’m sure. ;) I don’t use MAMP, however. I’ve always preferred the native tools, as much as possible. Sometimes I have to bump up php with Homebrew, so it’s really a game of half/half between Mac native and Homebrew things.

Untested, but this may be all you need to do differently to use Mailhog with macOS’ native PHP setup.


TXP Builders – finely-crafted code, design and txp

Offline

#55 2018-04-07 07:03:08

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,745
Website

Re: com_connect - form and contact mailer

colak wrote #310713:

You can edit the confirmation message by using the thanks attribute.

Regarding your second point… I could not see any way to do it without hacking the plugin.

Good to know about the thanks attribute. (Why do I keep missing this stuff about attributes in the docs?)

But, if the default was better, it wouldn’t be necessary to override it with a big text string in the tag.

Maybe a suggestion for plugin advancement would be to put all feedback messages as plugin preferences (textarea fields, please). But then again, if the defaults are tight, I don’t need to change them.

Offline

#56 2018-04-07 07:11:43

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,745
Website

Re: com_connect - form and contact mailer

jakob wrote #310715:

Untested, but this may be all you need to do differently to use Mailhog with macOS’ native PHP setup.

Thanks! I might give that a try when I have more time. I’ll report back if/when I do. This is the only form I would need it for, though. I’ll test live first and see what happens. ;)

Offline

#57 2018-04-07 07:18:14

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,745
Website

Re: com_connect - form and contact mailer

I put this in my styles to add under the confirmation message because the disappearance of the form might confuse people if they, for whatever reason I can’t imagine, wanted to send another message. Are there other ways of handling it?

.comThanks p:after {
	content:'(If you need to send another message, close your browser tab and revisit this page.)';
	display: block;
	font-size: .75rem;
	margin-top: .5em;
}

But in any case, that might be a good reason to have feedback messages as preference fields; so you could edit whatever you wanted.

Update: Just discovered:

  1. If I use the thanks="" attribute override. The CSS :after above doesn’t work anymore. Doesn’t display. Don’t know why not.
  2. You can use emoji in the thanks="" attribute. ;)

Last edited by Destry (2018-04-07 07:46:36)

Offline

#58 2018-04-07 07:18:30

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,357
Website

Re: com_connect - form and contact mailer

Destry wrote #310724:

But, if the default was better, it wouldn’t be necessary to override it with a big text string in the tag.

Default have (sometimes …) limits anyway. And if you want to improve the thanks message, you can also pull it from a TXP form, via the thanks_form="form name" attribute.

Maybe a suggestion for plugin advancement would be to put all feedback messages as plugin preferences (textarea fields, please).

Might be something yes. That would keep the contact form code easier to read.


Where is that emoji for a solar powered submarine when you need it ?

Offline

#59 2018-04-07 07:29:46

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,745
Website

Re: com_connect - form and contact mailer

Finally found where the attributes are listed. With the “Tags” descriptions, naturally. I will read a little more before my next dumb question.

Offline

#60 2018-04-07 07:48:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,286
Website GitHub

Re: com_connect - form and contact mailer

Destry wrote #310712:

“Your message was sent successfully.” … and… “Message was already sent. Fill out form again to send a new message.”

These are Textpack strings in the plugin so can be changed in your database if necessary. But I can change the default wording no problem. As colak says, the thanks message can be overridden in the tag, and as phiw13 says, you can specify a thanks_form if you really want to go to town. That might also solve your post-submission situation too as you can design the Form how you like.

You don’t necessarily have to tell people to refresh, btw. You can just offer a link to the same page URL without the #:

<a href="<txp:page_url />">Send another message</a>

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

Board footer

Powered by FluxBB