Events Made Easy › Forums › How do I … › Correct format for statement in template
- This topic has 6 replies, 2 voices, and was last updated 2 years, 4 months ago by Anonymous.
-
AuthorPosts
-
Tue 28 Jun 2022 at 13:56 #64391AnonymousInactive
Hi
I use a selection within a rsvp template for whether a user is logged out, a junior member or senior member. these are individual dropdowns. Issue i have is if somebody is logged in and their membership has expired i get no dropdown.
I am trying to create an or statement as below but cannot get it to work.
Can anybody see where my issue is or if there is a better way to do this maybe with a single drop down in stead of 3 seperate ones
[eme_if tag='#_IS_LOGGED_IN' value='0' || eme_if tag='#_IS_MEMBER_EXPIRED' value='1'] Non Member (Please select 1): #_SEATS{1} [/eme_if]
[eme_if tag='#_IS_USER_MEMBER_OF{Club Membership Senior Application}' value='1'] Senior Club Member (Please select 1): #_SEATS{2} [/eme_if]
[eme_if tag='#_IS_USER_MEMBER_OF{Club Membership Junior Application}' value='1'] Junior Club Member (Please select 1): #_SEATS{3} [/eme_if]Thanks in advance
Tue 28 Jun 2022 at 14:25 #64392FrankyKeymasterEME doesn’t support the or-logic you have there on the first line. I think this should work:
[eme_if tag='#_IS_LOGGED_IN' value='0'] Non Member (Please select 1): #_SEATS{1} [/eme_if]
[eme_if tag='#_IS_MEMBER_EXPIRED' value='1'] Non Member (Please select 1): #_SEATS{1} [/eme_if]
[eme_if tag='#_IS_USER_MEMBER_OF{Club Membership Senior Application}' value='1'] Senior Club Member (Please select 1): #_SEATS{2} [/eme_if]
[eme_if tag='#_IS_USER_MEMBER_OF{Club Membership Junior Application}' value='1'] Junior Club Member (Please select 1): #_SEATS{3} [/eme_if]Tue 28 Jun 2022 at 16:18 #64393AnonymousInactiveOk i have tried this but still get the result of no dropdown for the seat when the user is logged in but their membership has expired, here is the full template, have i implemented it correctly?
Booking closes on #_RSVPEND
<table class=”eme-rsvp-form”>
<tbody>
<tr>
<th scope=”row”>Last Name*:</th>
<td>#_LASTNAME</td>
</tr>
<tr>
<th scope=”row”>First Name*:</th>
<td>#REQ_FIRSTNAME</td>
</tr>
<tr>
<th scope=”row”>E-Mail*:</th>
<td>#_EMAIL</td>
</tr>
<tr>
<th scope=”row”>Phone number*:</th>
<td>#REQ_PHONE</td>
</tr>
<tr>
<th scope=”row”>BRCA Number*:</th>
<td>#_FIELD{BRCA}</td>
</tr>
<tr>
<th scope=”row”>Transponder Number*:</th>
<td>#REQ_FIELD{Transponder_Number}</td>
</tr>
<tr>
<th scope=”row”>Entry Class*:</th>
<td>#REQ_FIELD{Entry Class}</td>
</tr>
<tr>
<th scope=”row”>Ability*:</th>
<td>#REQ_FIELD{Ability}</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_LOGGED_IN' value='0'] Non Member (Please select 1):</th>
<td>#_SEATS{1}</td>
<td>[/eme_if]</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_MEMBER_EXPIRED' value='1'] Non Member (Please select 1):</th>
<td>#_SEATS{1}</td>
<td>[/eme_if]</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_USER_MEMBER_OF{Club Membership Senior Application}' value='1'] Senior Club Member (Please select 1):</th>
<td>#_SEATS{2}</td>
<td>[/eme_if]</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_USER_MEMBER_OF{Club Membership Junior Application}' value='1'] Junior Club Member (Please select 1):</th>
<td>#_SEATS{3}</td>
<td>[/eme_if]</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_MEMBER_EXPIRED' value='']
<p style=”color: red;”>If you hold a current club membership, log in for members discount</p>
[/eme_if]</th>
</tr>
<tr>
<th scope=”row”>Comment:</th>
<td>#_COMMENT</td>
</tr>
<tr>
<th scope=”row”>Please confirm you consent for KMRC to store and use your data as defined in our GDPR Privacy Policy:*:</th>
<td>#_GDPR</td>
</tr>
</tbody>
</table>
#_CAPTCHA
#_SUBMITTue 28 Jun 2022 at 18:43 #64394FrankyKeymasterFirst: you should put the eme_if tags around the tr-tags, otherwise your generated html won’t be valid.
Second (I just got home, so checked the code a bit and got more coffee): the #_IS_MEMBER_EXPIRED placeholder is only valid in a member context, not as a generic placeholder (which is logical: I don’t know which membership you’re talking about …). In your case, as documented in the generic placeholders ( https://www.e-dynamics.be/wordpress/generic-placeholders/ ), you should use #_IS_USER_MEMBER_EXPIRED{xxx}Wed 29 Jun 2022 at 14:03 #64395AnonymousInactiveGreat i am getting somewhere but with a small issue. If i add a single membership #_IS_USER_MEMBER_EXPIRED{xxx} as described in the generic placeholders it works, once i add the second membership i need to check (as below) it does not work. I believe it is the way i am writing it and have tried other variations to experiment.
I also do not understand how to put eme_if tags around the tr-tags, but the code does work anyway providing i only check one membership. Sorry for my ignorance about the code, slowly trying to learn.Booking closes on #_RSVPEND
<table class=”eme-rsvp-form”>
<tbody>
<tr>
<th scope=”row”>Last Name*:</th>
<td>#_LASTNAME</td>
</tr>
<tr>
<th scope=”row”>First Name*:</th>
<td>#REQ_FIRSTNAME</td>
</tr>
<tr>
<th scope=”row”>E-Mail*:</th>
<td>#_EMAIL</td>
</tr>
<tr>
<th scope=”row”>Phone number*:</th>
<td>#REQ_PHONE</td>
</tr>
<tr>
<th scope=”row”>BRCA Number*:</th>
<td>#_FIELD{BRCA}</td>
</tr>
<tr>
<th scope=”row”>Transponder Number*:</th>
<td>#REQ_FIELD{Transponder_Number}</td>
</tr>
<tr>
<th scope=”row”>Entry Class*:</th>
<td>#REQ_FIELD{Entry Class}</td>
</tr>
<tr>
<th scope=”row”>Ability*:</th>
<td>#REQ_FIELD{Ability}</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_LOGGED_IN' value='0'] Non Member (Please select 1):</th>
<td>#_SEATS{1}</td>
<td>[/eme_if]</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_USER_MEMBER_EXPIRED{Club Membership Senior Application},#_IS_USER_MEMBER_EXPIRED{Club Membership junior Application}' value='1'] Non Member (Please select 1):</th>
<td>#_SEATS{1}</td>
<td>[/eme_if]</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_USER_MEMBER_OF{Club Membership Senior Application}' value='1'] Senior Club Member (Please select 1):</th>
<td>#_SEATS{2}</td>
<td>[/eme_if]</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_USER_MEMBER_OF{Club Membership Junior Application}' value='1'] Junior Club Member (Please select 1):</th>
<td>#_SEATS{3}</td>
<td>[/eme_if]</td>
</tr>
<tr>
<th scope=”row”>[eme_if tag='#_IS_MEMBER_EXPIRED' value='']
<p style=”color: red;”>If you hold a current club membership, log in for members discount</p>
[/eme_if]</th>
</tr>
<tr>
<th scope=”row”>Comment:</th>
<td>#_COMMENT</td>
</tr>
<tr>
<th scope=”row”>Please confirm you consent for KMRC to store and use your data as defined in our GDPR Privacy Policy:*:</th>
<td>#_GDPR</td>
</tr>
</tbody>
</table>
#_CAPTCHA
#_SUBMITWed 29 Jun 2022 at 16:00 #64396FrankyKeymaster#_IS_USER_MEMBER_EXPIRED{Club Membership Senior Application},#_IS_USER_MEMBER_EXPIRED{Club Membership junior Application} ==> should be:
#_IS_USER_MEMBER_EXPIRED{Club Membership Senior Application,Club Membership junior Application}To put something around tr-tags:
[eme_if tag='#_IS_USER_MEMBER_OF{Club Membership Junior Application}' value='1'] <tr> <th scope="row"> Junior Club Member (Please select 1):</th> <td>#_SEATS{3}</td> <td></td> </tr> [/eme_if]
This way your th-tags and td-tags will balance out again, and you can even drop the last (now empty) td-column if you don’t use 3 columns.
However, switching between wordpress “smart” html editor and the plain text editor will then (using the suggested syntax I just gave) brake your template, so watch out 🙂 Reason is that wordpress tries to be smart and will move text between tr-lines that fall “outside” the tr-definition out of the table as a whole …Thu 30 Jun 2022 at 11:42 #64398AnonymousInactiveThats great, all working and your explanation on tags makes perfect sense.
Thank you for the continued support
Carl
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.