Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#817 2010-07-08 17:54:23

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

The zem_contact_secret field won’t work for what you have in mind, because you’re calculating the costs using jQuery, so that happens in the visitor’s browser, while zem_contact_secret contents never reach the browser, so you can’t store anything in there that you want to modify in the browser on the client side.

Solution: use another zem_contact_text for storing the results of the costs calculation. You can style that field to match your needs.

Offline

#818 2010-07-08 20:18:28

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: zem_contact_reborn 4.0.3.20

Thank you all for these suggestions! The zem_contact_text field does work , but not all the way… I can see the total updating in the text field in the DOM via firebug — but it doesn’t actually go through to the email. ZCR treats it as if no value was entered. I’ll explore the link that datorhaexa suggested and will see if there is a way to get it to pass through.

Update: It works perfectly. I just had to carefully read the solution that datorhaexa pointed me to here

I gave a zem_contact_text tag the correct name/label to match the id in the jquery calc code:

<div style="visibility:hidden"><txp:zem_contact_text name="Total" label="Total" required="0" break="" /></div>

Added this to the jquery calc code (make sure to put “.val” instead of “.text”:

$("#Total").val(
// round the results to 2 digits
"$" + sum.toFixed(2)
);

Thanks again!

Last edited by photonomad (2010-07-08 20:38:26)

Offline

#819 2010-07-15 04:51:16

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

Re: zem_contact_reborn 4.0.3.20

I have an input field that I don’t want to supply a ‘label’ – but when I receive an email, naturally there is no ‘label:’ in the output, just the value provided by the user

<txp:zem_contact_text label="" label="House Number" required="1" break="" /> - <txp:zem_contact_text name="House-Number-End-Range" label="" required="0" break="" />

Result, in email:

House Number: 123

: 456

I thought ‘name’ might supply this when a ‘label’ attribute wasn’t specified, but that doesn’t seem to be the case

can you suggest a workaround?

(I could give it a label, and hide it with CSS, for example)

Offline

#820 2010-07-15 16:50:23

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

This will add a label for the email only and not show the label on the website:

<txp:zem_contact_reborn ...>
  <txp:zem_contact_text name="myname" label="" />
  <txp:php>
    global $zem_contact_labels;
    $zem_contact_labels['myname'] = 'Label_that_will_be_used_in_the_email';
  </txp:php>
</txp:zem_contact_reborn>

Offline

#821 2010-07-16 01:11:30

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

Re: zem_contact_reborn 4.0.3.20

Thank you Ruud, perfect

Offline

#822 2010-07-18 23:48:50

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

Re: zem_contact_reborn 4.0.3.20

Ruud, am looking at processing email responses with an ASP script to update a database (external to Textpattern). I could edit the plugin code to make the labels & responses more like XML (so each is clearly defined); has someone done this already? Any comments or suggestions?

Offline

#823 2010-07-19 10:05:11

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

Instead of editing the plugin, use the ‘zemcontact.submit’ callback event.

Offline

#824 2010-07-19 13:34:47

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 153
Website

Re: zem_contact_reborn 4.0.3.20

funtoosh schrieb:


i have a question on using the (great!) user selectable recipient feature with ZCR

hi again,
i have a follow-up question to making use of a dropdown for recipients with ZCR — i was trying to generate my list of recipients from txp, which i thought should look sth. like this:

<txp:php>
  $title = title (array ());
  $email = custom_field (array ('name' => 'Email'));
  global $zem_contact_form;
  switch($zem_contact_form['Adressat'])
  {
     case '$title':
      echo '$email';
      break;
    default:
      echo 'test@example.com';
  }
</txp:php>

it’s not working though ;—(
any ideas on where i went wrong?

cheers,
enjoy the summer heat,
-f

Last edited by funtoosh (2010-07-19 13:35:42)

Offline

#825 2010-07-19 15:36:05

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 153
Website

Re: zem_contact_reborn 4.0.3.20

uhm, i guess i’d have to wrap my

    case '$title':
      echo '$email';
      break;

in the equivalent of a custom_article to loop thru all articles, wouldn’t i?

Offline

#826 2010-07-20 07:09:52

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

Can you explain exactly what you’re trying to do. Where do you want to use this form: on an individual article page or on a page that contains a list of articles? Can the user choose from all the article titles?

Offline

#827 2010-07-20 09:03:41

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 153
Website

Re: zem_contact_reborn 4.0.3.20

ruud, sorry, i should have provided the context!

i am using an individual contact-page, and all articles i have describe team members — the title referring to their name, and a custom field specifying their email address. the contact form should generate its dropdown from the articles’ txp:title’s and txp:custom_field’s.
i hope that makes sense now.

groetjes!
-f

Offline

#828 2010-07-20 19:26:06

alanfluff
Member
From: Ottawa, Canada
Registered: 2008-09-15
Posts: 222
Website

Re: zem_contact_reborn 4.0.3.20

Hello zem_knowledgeable peeps,

I’ve looked hard here, in GoogleLand and in the PHP docs (in the faint hope I could code it) for a way of making an email’s Subject line look like this

From example.com, page: [Fred Dibner]

rather than like this

From example.com, page: [Fred Dibner]

I’ve been looking for a plugin I could use to wrap the <txp:title /> tag so it converted down any entities (wrong term?) into plain-text.

Sorry to be asking another question (I feel like a needy-child-clutz).

Any pointers, greatly appreciated.

Cheers, -Alan

PS: I hope this was the right place to ask this, rather than opening a new thread.


At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A

Offline

Board footer

Powered by FluxBB