Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#136 2018-10-15 10:33:47
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: com_connect - form and contact mailer
it’s going too complicated for me… thank you for thinking and helping phiw13!
Offline
#137 2018-10-15 10:45:38
Re: com_connect - form and contact mailer
I’m not even sure this is a good idea (please be gentle), but is it possible to insert a HTML wrapper around the contents inside the <form> generated by this plugin?
Using <txp:com_connect> automatically (brilliantly!) creates a form and applies a class to the form element class="comConnectForm"
Out-of-the-box Bootstrap wants a wrapper after the form tag, like this:
<form>
<div class="form-group">...
Is there an easy way to insert this wrapper? (So I can be lazy and just use Bootstrap’s styling rather than have to style .comConnectForm )
Offline
#138 2018-10-15 18:43:23
Re: com_connect - form and contact mailer
There should be a native solution, but I have never used com_connect. If not, etc_query can do it:
<txp:etc_query data='<!-- form generating tag --><div id="wrapper" class="form-group"></div>'
query="form" replace='node()/=id("wrapper");id("wrapper")/=../form' />
Replace <!-- form generating tag --> with whatever outputs your <form>...</form> block.
Offline
#139 2018-10-15 23:10:59
Re: com_connect - form and contact mailer
gavnosis wrote #314609:
I’m not even sure this is a good idea (please be gentle), but is it possible to insert a HTML wrapper around the contents inside the
<form>generated by this plugin?Using
<txp:com_connect>automatically (brilliantly!) creates a form and applies a class to the form elementclass="comConnectForm"Is there an easy way to insert this wrapper? (So I can be lazy and just use Bootstrap’s styling rather than have to style
.comConnectForm)
You can use the <txp:com_connect /> as a container tag and add the wrapper div. See example 2 (or the plugin help file).
<txp:com_connect>
<div class="whatever">
<!-- insert your form fields -->
</div>
</txp:com_connect>
Last edited by phiw13 (2018-10-15 23:12:48)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#140 2018-10-16 09:13:30
Re: com_connect - form and contact mailer
Thank you phiw13 for pointing out the obvious. And thank you etc for providing heavy-lifting techniques…
There is native solution, and I was so convinced it was something complicated I missed the totally obvious ;-)
Thank you
<txp:com_connect>
<div class="form-group">
works a treat!
Offline
#141 2018-10-19 08:41:02
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: com_connect - form and contact mailer
how to change input placeholder text color? :)
this way, it’s not working:
.comConnectForm input.comText{
font-size:17px;
color:#bbb !important;
}
any ideas?
Offline
#142 2018-10-19 08:48:12
Re: com_connect - form and contact mailer
Gallex wrote #314641:
how to change input placeholder text color? :)
the ::placeholder pseudo element ?
input::-ms-input-placeholder {
color: red;
}
/* supported by Safari 9.2+ Firefox 51, Chrome 57 */
::placeholder {
color: pink;
opacity: 1; /* Firefox; */
}
Last edited by phiw13 (2018-10-19 08:48:48)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
#143 2018-10-19 10:38:27
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: com_connect - form and contact mailer
Offline
#144 2018-11-17 09:50:29
Re: com_connect - form and contact mailer
There seems to be a problem with the validation of the com_connect_file tag. This is how I am using it:
<txp:com_connect_file label="Send file" max="8000000" accept=".pdf,.docx,.doc" required="1" />
The validation error reads:
Attribute maxlength is only allowed when the input type is email, password, search, tel, text, or url.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#145 2018-12-12 17:01:57
Re: com_connect - form and contact mailer
dragondz has flagged up that some people don’t use the label attribute but use placeholders instead to indicate what users are expected to supply.
It’s of course possible to use label="" to suppress them, but that also means the default email that’s sent out doesn’t have the label(s) in front of the fields content. Even specifying the name attribute doesn’t fix this.
You can get around that by making your own body_form for the email body and hard-coding your own labels in.
Question is: are these workarounds okay or can/should we do something better in the default email template? A few options I’ve come up with, none of which are particularly appealing:
- Leave it alone – the
body_formattribute suffices for such cases. - Introduce some flag attribute to control this behaviour, like display_label and set it true by default. Bonus points for being able to override it on the containing
<txp:com_connect>tag for all contained tags. - Automatically fall back on the
namefield (although that might backfire with things like checkboxes/radios because their name is auto-generated in some cases, I think). - Introduce a new attribute that can be used as the field label that appears in the email. Defaults to label unless this overrides it.
- Set some user-definable priority system up on the container tag that allows you to define what happens, e.g.
placeholder:label:name:"Field"would search the given fields in the given order and use the last entry as a fallback label in the email if all the previous ones were empty. Would only apply to the built-in message body, which is not ideal from a usability stance. - Something else…
Anyone have any views on this? Is it a problem we should tackle? If so, how?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#146 2018-12-12 19:06:06
Re: com_connect - form and contact mailer
What if the plugin detects if there are labels and if not, the placeholder names are sent?
Too much maybe?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#147 2018-12-13 07:42:53
Re: com_connect - form and contact mailer
Hi, for me the solution 2 should be ok if it s simple to code.
Offline
#148 2018-12-21 07:51:11
Re: com_connect - form and contact mailer
Hello!
Is there any way to integrate the txp:com_connect form into a CRMs. In my case as far as I see it should be made like this: Request POST
http://site.com?token={dealer_token}.
How can I attach this “tail” ?token={dealer_token} to submited forms’ URLs?
Offline
#149 2018-12-21 09:52:08
Re: com_connect - form and contact mailer
Just in case, you could try to insert
<input type="hidden" name="token" value="dealer_token_value" />
into your form, though this requires that CRM gets token from POST data.
Offline
#150 2018-12-24 08:01:01
Re: com_connect - form and contact mailer
etc wrote #315666:
Just in case, you could try to insert
<input type="hidden" name="token" value="dealer_token_value" />...into your form, though this requires that CRM gets
tokenfromPOSTdata.
Thanks. It does not work this way. The manual suggests the following code for JavaScript:
var request = new XMLHttpRequest();
request.open('GET', 'https://private-anon-e12e0a7fe4-ramex.apiary-mock.com/treatment/sources?token=3.844e83ae03647071f77bb...');
request.onreadystatechange = function () {
if (this.readyState === 4) {
console.log('Status:', this.status);
console.log('Headers:', this.getAllResponseHeaders());
console.log('Body:', this.responseText);
}
};
request.send();
Or PHP below. Can it be integrated with txp:com_connect somehow?
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://private-anon-e12e0a7fe4-ramex.apiary-mock.com/treatment/sources?token=3.844e83ae03647071f77bb...");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);You haven’t made
Last edited by zenman (2019-01-16 18:35:02)
Offline