Events Made Easy › Forums › Bug fixed or feature request implemented › Conditional not Working
Tagged: conditional code
- This topic has 11 replies, 2 voices, and was last updated 10 years, 1 month ago by Anonymous.
-
AuthorPosts
-
Fri 5 Sep 2014 at 23:23 #52767AnonymousInactive
All my other conditional statements are working, but #_EVENTDETAILS ( / #_NOTES). Am I coding my sub-conditions wrong?
Here is my code for “Default single event format”:
[eme_if tag="#_EVENTCATEGORIES" notvalue=Work]
<section class=”column column-1 grid-left-0 grid-width-12″>
<div class=”single-event-text-wrapper”>
<h1>#_EVENTNAME</h1>
<h2 id=”date”>#_{F jS}
[eme_if2 tag="#_{F j Y}" notvalue="#@_{F j Y}"]
[eme_if3 tag="#Y" notvalue="#@Y"], #Y[/eme_if3] –
[eme_if4 tag="#F" notvalue="#@F"]#@_{F }[/eme_if4]
#@_{jS}[/eme_if2], #@_{Y}</h2>
#_{l}[eme_if2 tag="#_{F j Y}" notvalue="#@_{F j Y}"] – #@_{l}[/eme_if2]
[eme_if3 tag="#_{F j Y}" value="#@_{F j Y}"] only[/eme_if3]
[eme_if2 tag="#ESC_ATT{Leader}" is_empty=0]<h2>Leader</h2>#_ATT{Leader}[/eme_if2]
[eme_if2 tag="#ESC_TOWN" is_empty=0]<h2>Location</h2>#_ADDRESS<br>#_TOWN[/eme_if2]
[eme_if2 tag="#_EVENTDETAILS" is_empty=0]<h2>Additional Information</h2>#_EVENTDETAILS[/eme_if2]
</div>
</section><section class=”column column-2 grid-left-0 grid-width-12″><div class=”single-event-map-wrapper”>#_MAP</div><div class=”event-return-button”>View Full Itinerary</div></section>
[/eme_if][eme_if tag="#_EVENTCATEGORIES" value=Work]
[eme_if2 tag="#_AVAILABLESPACES" ge=1]
<div class=”eventpage-work-day”>#l</div>
<div class=”eventpage-work-date”>#_{F jS}</div>
[eme_if3 tag="#_AVAILABLESPACES" ge=1]<div class=”eventpage-work-available”>Available</div>[/eme_if3]
[eme_if4 tag="#_AVAILABLESPACES" value=0]<div class=”eventpage-work-booked”>Booked</div>[/eme_if4]
<div class=”eventpage-work-text”>Please enter your information below to submit your reservation.</div>
<div class=”eventpage-work-form-wrapper”>#_ADDBOOKINGFORM</div>
[/eme_if2]
[/eme_if]Sat 6 Sep 2014 at 00:03 #52768AnonymousInactiveI’ve cleaned up the above code and I still cannot get the [eme_if2 tag="#_EVENTDETAILS" is_empty=0]<h2>Additional Information</h2>#_EVENTDETAILS[/eme_if2] line to work.
It there a bug?
I cannot be sure of this, but I know that I was using #_NOTES in a similar conditional statement under previous versions.
Sat 6 Sep 2014 at 09:37 #52769FrankyKeymasterAs the doc says: “You can use all placeholders in the if-part, just by prepending them with “ESC”, e.g you could use this for single event formatting:”
In your case: change e.g. [eme_if2 tag="#_EVENTDETAILS" is_empty=0] to [eme_if2 tag="#ESC_EVENTDETAILS" is_empty=0]I’ll explain in the doc what ESC does here
Fri 26 Sep 2014 at 21:30 #52900AnonymousInactiveI still don’t have this working…
I am using:
[eme_if3 tag="#ESC_EVENTDETAILS"]<h2>Additional Information</h2>#_EVENTDETAILS[/eme_if3]
I want it to display the EVENTDETAILS only if there is text in the event’s Details section.
According the the documentation, this should work. Also, it works for my other event information, but not eventdetails / notes.
Is there something deeper here?
Fri 26 Sep 2014 at 23:10 #52902FrankyKeymasterJust tried (copy/paste) your code: works just fine here.
Edit: although there’s not much meaning in testing if it is empty: if it really is empty, the replacement will be an empty string … But probably you want the “additional information” header too (although that too can be in the event details section)
Sat 27 Sep 2014 at 02:11 #52906AnonymousInactiveOk, thank you for clarifying for me. I’ll check things on my end again.
Fri 3 Oct 2014 at 15:06 #52972AnonymousInactiveI don’t understand what is going on here… will not work on my end.
Tested several things:
Attempt 1
Placed only this code is my “Default Single Event Format”:[eme_if tag="#ESC_EVENTDETAILS"]<h2>Additional Information</h2>#_EVENTDETAILS[/eme_if]
Verified that text was truly in the event’s “Details” section.
Did not workAttempt 2
Placed only this code is my “Default Single Event Format”:#_EVENTDETAILS
WorkedAttempt 3
Placed only this code is my “Default Single Event Format”:[eme_if tag="#ESC_TOWN"]<h2>Additional Information</h2>#_EVENTDETAILS[/eme_if]
WorkedAttempt 4
Switched “TOWN” back to “EVENTDETAILS”:[eme_if tag="#ESC_EVENTDETAILS"]<h2>Additional Information</h2>#_EVENTDETAILS[/eme_if]
*Refreshed browser* Worked – but then stopped working (Browser cache?)As it stands, I can place other placeholders in the conditional statement and it will work, but if I use “#ESC_EVENTDETAILS”, none of the #_EVENTDETAILS will be shown.
I don’t know what else I could try here. Any thought?
Fri 3 Oct 2014 at 15:40 #52973FrankyKeymasterhmmm … maybe your event details contain characters that I didn’t try …
Could you mail me in private the event details as a text-attachment, so I can test that too?Fri 3 Oct 2014 at 16:05 #52974AnonymousInactiveYes, just confirmed that.
It has something to do with the event details for that one event.
A simple “test” in the event details worked fine.
Email with the text attachment is coming your way…
Fri 3 Oct 2014 at 18:02 #52976AnonymousInactiveSeems that it doesn’t like
<strong>
‘s or<a>
‘s in the event details.Adding either will stop the conditional code from working.
Sat 4 Oct 2014 at 00:11 #52987FrankyKeymasterIt’s in fact a little bit of everything … wordpress shortcodes don’t seem to like html tags in them, so I now escape those too:
Sat 4 Oct 2014 at 06:13 #52990AnonymousInactiveIt works!
Thanks for adding this!
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.