• Hi

    I’m struggling with the Conditional Placeholders. I thought it was a nesting problem but after I add the extra PHP to my wp-config.php file:

    define('EM_CONDITIONAL_RECURSIONS',2);

    the issue remains.

    If a event is in {has_category_X} I have a lay-out for that.

    {has_category_679}
    <h1>#_EVENTNAME</h1>
    <center><h2>#_EVENTDATES</h2></center>
    <section class="em-item-header"  style="--default-border:#_CATEGORYCOLOR;">
    	<section class="em-event-content">
    	#_EVENTNOTES
    </section>
    		<section class="em-item-meta-column">
    			{has_location_venue}
    			<section class="em-event-where">
    				<h3>Place to be</h3>
    				<div class="em-item-meta-line em-event-location">
    					<span class="em-icon-location em-icon"></span>
    					<div>
    						#_LOCATIONLINK<br>
    						#_LOCATIONADDRESS<br>
    					#_LOCATIONPOSTCODE #_LOCATIONTOWN
    					</div>
    				</div>
    			</section>
    			{/has_location_venue}
    			{has_event_location}
    			<section class="em-event-where">
    				<h3>Where</h3>
    				<div class="em-item-meta-line em-event-location">
    					<span class="em-icon-at em-icon"></span>
    					#_EVENTLOCATION
    				</div>
    			</section>
    			{/has_event_location}
    		</section>
    </section>
    
    {/has_category_679}

    So far so good. If I have an event not in category X I have a different lay-out. With extra nesting for the prize information. If I understand it corectly.

    <h1>
    #_EVENTNAME
    </h1>
    <h3>
    	<center>#_EVENTDATES van #_24HSTARTTIME tot #_24HENDTIME<br>
    		{bookings_open}<a href="#em-event-booking-form" class="button input with-icon-right">
    							Inschrijven			<span class="em-icon-clock em-icon"></span>
    				</a>{/bookings_open}
    		{bookings_closed}<h3>
    		Volzet
    		</h3>{/bookings_closed}
    		</center>
    </h3>
    <section class="em-item-header"  style="--default-border:#_CATEGORYCOLOR;">
    <section class="em-event-content">
    	#_EVENTNOTES
    </section>
    	<h2>
    		Praktisch
    	</h2>
    	<div class="em-item-meta">
    		<section class="em-item-meta-column">
    			<section class="em-event-when">
    				<h3>Wanneer?</h3>
    				<div class="em-item-meta-line em-event-date em-event-meta-datetime">
    					<span class="em-icon-calendar em-icon"></span>
    					#_EVENTDATES????
    				</div>
    				<div class="em-item-meta-line em-event-time em-event-meta-datetime">
    					<span class="em-icon-clock em-icon"></span>
    					#_EVENTTIMES
    				</div>
    			</section>		
    			{is_free}
    			<section class="em-event-bookings-meta">
    				<h3>Prijs</h3>
    				{bookings_open}
    				<div class="em-item-meta-line em-event-prices">
    					<span class="em-icon-ticket em-icon"></span>
    					Wanneer een boek wordt aangekocht in onze stripwinkel is het signeren gratis. Breng je een eigen boek mee, ben je je verplicht om een signeervignet aan te kopen.
    				</div>
    				<a  target="_blank" class="button input with-icon-right">
    							signeervignet		<span class="em-icon-ticket em-icon"></span>
    				</a>
    				<a href="#em-event-booking-form" class="button input with-icon-right">
    							Selecteer tijdslot			<span class="em-icon-clock em-icon"></span>
    				</a>
    				{/bookings_open}
    				{bookings_closed}
    				<div class="em-item-meta-line em-event-prices">
    					<span class="em-icon-ticket em-icon"></span>
    					Inschrijven niet meer mogelijk				</div>
    				{/bookings_closed}
    			</section>
    			{/is_free}
    			{not_free}
    			<section class="em-event-bookings-meta">
    				<h3>Prijs</h3>
    				{bookings_open}
    				<div class="em-item-meta-line em-event-prices">
    					<span class="em-icon-ticket em-icon"></span>
    					#_EVENTPRICERANGE
    				</div>
    				<a href="#em-event-booking-form" class="button input with-icon-right">
    							Inschrijven			<span class="em-icon-ticket em-icon"></span>
    				</a>
    				{/bookings_open}
    				{bookings_closed}
    				<div class="em-item-meta-line em-event-prices">
    					<span class="em-icon-ticket em-icon"></span>
    					Inschrijven niet meer mogelijk				</div>
    				{/bookings_closed}
    			</section>
    			{/not_free}
    			
    		</section>
    
    		<section class="em-item-meta-column">
    			{has_location_venue}
    			<section class="em-event-where">
    				<h3>Waar?</h3>
    				<div class="em-item-meta-line em-event-location">
    					<span class="em-icon-location em-icon"></span>
    					<div>
    						#_LOCATIONLINK<br>
    						#_LOCATIONADDRESS<br>
    					#_LOCATIONPOSTCODE #_LOCATIONTOWN
    					</div>
    				</div>
    			</section>
    			{/has_location_venue}
    			{has_event_location}
    			<section class="em-event-where">
    				<h3>Where</h3>
    				<div class="em-item-meta-line em-event-location">
    					<span class="em-icon-at em-icon"></span>
    					#_EVENTLOCATION
    				</div>
    			</section>
    			{/has_event_location}
    		</section>
    	</div>
    </section>
    
    {has_bookings}
    <section class="em-event-bookings">
    	<a name="em-event-booking-form"></a>
    	<h2>Inschrijven</h2>
    	#_BOOKINGFORM
    </section>
    {/has_bookings}

    If I place this code between the condition {no_category_X} the condition for {bookings_open} doesn’t work. So I thought that was a nesting problem. But it seems to be something else.

    Also adding the condition {has_image}#_EVENTIMAGE{/has_image} in the first part above #_EVENTNOTES in the {has_category_679} doesn’t work either. But that’s because I’m struggling with the condition {no_category_X}.

    Any tips in what I’m missing?

  • The topic ‘struggling with the Conditional Placeholders’ is closed to new replies.