Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

#73 2006-01-17 04:10:59

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Plug-in: zem_contact_reborn

pretty good bombsite – it would be a bonus if a class “zemRequired” was added to required labels as well – e.g. label class=“name zemRequired” …

allows styling of individual labels as well as overlaying a ‘required’ style

similarly, if a class “zemError” was attach to labels & inputs if required and not completed – e.g. label class=“name zemRequired zemError” … input class=“name zemRequired zemError”

see if anyone else finds that of interest, and if it’s doable … thanks

Offline

#74 2006-01-17 04:29:49

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

Am I right in thinking that you can have 2 class attributes within the same tag? This will need to go inside a conditional as not everyone will have the same “required” settings. Mmmm.

I have the feeling your “error” requirements are the most difficult but then I know nothing about this PHP stuff as you know.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#75 2006-01-17 04:59:41

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Plug-in: zem_contact_reborn

yes, you can have multiple classes e.g. label class=“hilite serifa classic” … and I imagined that if the attribute “required=yes” was used, the class could be appended

however I’m in the same PHP ballpark as you so no worries : )

Offline

#76 2006-01-17 06:53:10

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

I haven’t released this yet. I’m still testing. Turns out the error messages were the easiest. They are output as a “ul” so I’ve given the ul tag a class=“zemError”.

For the “required=yes” labels I have a second “class=zemRequired” alongside the “class=$name” so you can set an overall “required” style as well as do some individual adjustments if necessary.

I’ve sorted the “checkbox” and the “select” functions in the same way too. So everything should now be at the same point.

Would there be any benefit to adding a class to the “input” of a “required=yes” field?

I don’t know enough to sort out things like highlighting the required field when an error is output. Maybe one of the other lads can fix that. Or maybe I will learn all about it tomorrow (that’s today really).


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#77 2006-01-17 07:12:09

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Plug-in: zem_contact_reborn

> Would there be any benefit to adding a class to the “input” of a “required=yes” field?

I suppose there could be – a lite yellow background or other style to make it stand out – thicker border maybe

> I don’t know enough to sort out things like highlighting the required field when an error is output.

done good so far : )

Offline

#78 2006-01-17 08:42:34

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

OK. I’ve added them to the “inputs” as well when required=“yes”.

Plug-in updated.

Let me know.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#79 2006-01-17 12:33:16

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Plug-in: zem_contact_reborn

I am trying to test the zem_contact_send_article for foreign character issues (BTW Stuart, its not really clear which bugs have been fixed with your latest versions).

Unfortunately, I am not getting the send_article to work. I have this:

Default form:
<code><txp:zem_contact_send_article linktext=“Email this article to a friend” /><txp:zem_contact send_article=“yes” form=“send_article” /></code>

send_article form:
<code><txp:zem_contact to=“me@myemail.com”>
<txp:zem_contact_email name=“receiver” />
</txp:zem_contact ></code>

I get a message ““To” address is missing.”

Is it really necessary to have the zem_contact_email name=“receiver” in a second form?

Offline

#80 2006-01-17 17:34:50

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

You’ve made the same mistake that I did jstubbs. You now have 2 zem_contact tags where you only need 1. You are used to the standard contact form usage where the form contains the zem_contact tag and you call it with a <code><txp:output_form form=“email” /></code> tag but this time you are calling the form with the zem_contact tag so you don’t require it in the form as well. Your “send_article” form should look something like:-

<code><p><txp:zem_contact_text label=“Your Name” required=“yes” size=“40” /></p>
<p><txp:zem_contact_email name=“receiver” label=“Friend’s Email Address” size=“40” /></p>
<p><txp:zem_contact_textarea label=“Extra Message” required=“no” /></p>
<p><txp:zem_contact_submit /></p></code>
<br />

though you don’t need the “textarea” if you don’t want it.

In your article form you need this where you want the link to appear:-

<code><txp:if_individual_article><txp:zem_contact_send_article linktext=“Email to a Friend” /></txp:if_individual_article></code>
<br />

then where you want the form to appear when the link is clicked you use this:-

<code><txp:if_individual_article><txp:zem_contact send_article=“yes” form=“email_friend” /></txp:if_individual_article></code>
<br />

Those last 2 examples need to be in your article’s form template.

I believe you had a problem with entered values not being retained when an error is output. That should be fixed and I think you also had a problem with one of the yes/no attributes not working properly which should be OK now as well.

Tranquillo is currently looking at the foreign characters problem and separating out the language file.

Last edited by thebombsite (2006-01-17 17:43:08)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#81 2006-01-17 19:29:02

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Plug-in: zem_contact_reborn

thebombsite wrote:

@Els – thought you might jump in while I was asking eh? :grin:

It was worth a try… ;) Anyway, forget it, I figured it out. In case anyone else can use it, this is an example how to use multiple languages for error messages (works only if each contact form is in a different section):

This line:

'field_missing'   => "Required field, “<strong>$var1</strong>”, is missing.",

becomes:

'field_missing'   => '<txp:if_section name="nl-reserveren">Verplicht veld, "<strong>'.$var1.'</strong>", ontbreekt.</txp:if_section><txp:if_section name="en-reservations">Required field, "<strong>'.$var1.'</strong>", is missing.</txp:if_section><txp:if_section name="pt-reservacoes">Preencha o campo obrigatório, "<strong>'.$var1.'</strong>".</txp:if_section>',

Of course you can do the same for the other messages.

Last edited by doggiez (2006-01-17 19:33:39)

Offline

#82 2006-01-17 21:54:40

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Plug-in: zem_contact_reborn

*thebombsite: *One thing that I think would make this plugin even more useful would be an “email a copy to me” checkbox for site users. Even an option just to do this by default. Is this a ticky bit to add? I there’s several people, NeilA and myself included, who’ve been hoping for this capability.

Cheers, Thanks for the update of this plugin.

Offline

#83 2006-01-17 22:41:35

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Plug-in: zem_contact_reborn

I did have a method in mind for this actually mrdale, though I need to do a bit of checking up first, not being a coder. It would be a default method though. Basically you would set an attribute “copysender=yes” in the tag, and if it is set, the “from” address is added to the “to” address and the email sent to both addresses. I haven’t even thought about using a checkbox. That would be way over my head methinks though we do have others working on the code.

@Els – I didn’t realise you could use TXP tags inside a plug-in like that!!

Last edited by thebombsite (2006-01-17 22:47:46)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#84 2006-01-17 23:39:48

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Plug-in: zem_contact_reborn

I noticed that following the instructions for removing the automatic break (<code><br /></code>) did not work with the <code>zem_contact_email</code>. To fix that I added <pre><code>‘break’ => br,</code></pre> at about line 351 and <pre><code>‘break’ => $break,</code></pre> at about line 406. This seemed to remedy the situation. I’m using version 4.0.3.07 of the plugin.

Last edited by jdykast (2006-01-17 23:45:07)

Offline

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

Board footer

Powered by FluxBB