Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#133 2016-11-20 21:14:28

jeroenvg
Member
From: netherlands
Registered: 2010-04-21
Posts: 34

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

hello again!

i’m drafting a custom plugin for public visitors to book a workshop or course. zcr seems the current plugin to build upon, instead of mem_form/ mem_self_register (which i’ve used before).

one of the complications i’m trying to find a solution for, is the need to keep track of available free spots, like “<number> spots left of <number_total_spots>”.

Ruud’s rvm_counter looks like it could be useful for this purpose, because it stores the counter value in the database. that’s what i need.

question:
  • how would i go about only advancing a workshop’s counter when its form is submitted successfully?

suppose every workshop and course have their own page (article). it may be necessary to read back one counter ‘out of context’, e.g. when a single workshop needs promotion on the front page (supposedly through a generic form, available to the content manager of the site), like:

<prose>Last chance to book for ‘Answer to the Ultimate Question of Life’!</prose>
<form>Only <very_little> spots left of 42</form>

question:
  • how would i go about connecting a generic form to the counter it’s reporting about?

Offline

#134 2016-11-21 15:45:56

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,310

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

jeroenvg wrote #302981:

how would i go about connecting a generic form to the counter it’s reporting about?

Have you tried doing it on the Thank-you page? I don’t think there’s still article context but you might try carrying the article ID over there via adi_gps (or possibly rah_gps, too).


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#135 2016-11-25 16:11:06

jeroenvg
Member
From: netherlands
Registered: 2010-04-21
Posts: 34

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

uli wrote #302982:

Have you tried doing it on the Thank-you page?

that would solve my first question. thanks!

you quoted my second question, however. any thoughts on that one?

Offline

#136 2016-11-25 18:01:29

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

From the plugin help:

Display the current counter value, without changing it:

<txp:rvm_counter step="0" />

So I guess you could use the name attribute of the counter as the connecting element between the form and the counter, for example through the page name, e.g. txp:article_url_title:

<txp:article_custom section="workshops" wraptag="ul" break="li" class="course-list" limit="25">
  <article class="workshop">
    <h1><txp:title /></h1>
    <txp:excerpt />
    <p class="spots-message">Only <txp:rvm_counter name='<txp:article_url_title />' step="0" /> spots left of <txp:custom_field name="total_spots" />.</p>
    <a href="<txp:permlink />">Book now</a>
  </article>
</txp:article_custom>

or if your setup is different somehow, you could use a custom-field or a variable to link the form with the counter using a similar method.


TXP Builders – finely-crafted code, design and txp

Offline

#137 2016-12-02 10:26:43

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

A new beta is out. Yes, another one. Mops up bugs from the previous release.

Please see the change list on the releases page for more details.


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

#138 2016-12-02 16:48:47

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,094
Website Mastodon

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Bloke wrote #303122:

A new beta is out. Yes, another one. Mops up bugs from the previous release.

Please see the change list on the releases page for more details.

so the one that i obtained yesterday from github version 4.5.0.0 – is replaced by this beta version 4.5.0.0?

confused.


…. texted postive

Offline

#139 2016-12-02 18:05:58

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

bici wrote #303130:

so the one that i obtained yesterday from github version 4.5.0.0 – is replaced by this beta version 4.5.0.0?

Yep. I’ll get an actual release out soon, I promise. And that’ll be… version 4.5.0.0 :-)

Note to self: perhaps I ought to change the version string inside the plugin itself rather than just the GitHub release version number.


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

#140 2016-12-14 16:46:29

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Is there a NL Textpack for this plugin already?

Offline

#141 2016-12-14 18:23:15

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

RedFox wrote #303259:

Is there a NL Textpack for this plugin already?

I had one (in the MLP language string exchange thread) but it’s over 8 years old ;) Stef, can this still be used or does it need a complete make-over?

Offline

#142 2016-12-14 20:02:35

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

RedFox wrote #303259:

Is there a NL Textpack for this plugin already?

Not yet…

EDIT: uhh, or see below.

Last edited by Bloke (2016-12-14 20:04:42)


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

#143 2016-12-14 20:04:20

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

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Els wrote #303261:

I had one… can this still be used or does it need a complete make-over?

It could probably be used as a starting point. Things haven’t changed that much in terms of language strings in the plugin so it might be almost complete already.


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

#144 2016-12-15 18:13:38

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

"Els wrote”

Els!! :)

Nice to see you chime in! You’ve been missed.

Offline

Board footer

Powered by FluxBB