Beaver Themer Conditional Display Logic Conflict

I’m using Beaver Themer to create individual event pages for a site using The Events Calendar Pro. I’ve been having an issue where the Beaver Themer conditional display logic reverses when I have some Loops & Logic code on the page.

Beaver Themer’s conditional logic is set to display a certain module if the event has a certain tag. With the L&L code, the module only displays if the post DOES NOT have that tag.

Here’s the code that causes the conditional logic to flip:

<Set name=eventCatImage>
<Loop type=taxonomy_term taxonomy=tribe_events_cat post=current>
  <Field acf_image=v4m_category_default_image field=url />

<If field="image" exists>
  <Field image />
<Else />
  <img src="{Get eventCatImage}" />

For each event, I’m checking if the event has been given a featured image or not. If not, then an image specified in the event’s category should be used instead.

Removing this code from the Tangible Module in Beaver Themer causes the conditional display logic to work as expected.

For the tangible module with the problematic code, I’m writing the code directly in the module, not using an existing template.

Any suggestions on what I’m doing wrong and what to try in order to resolve the issue?


After a bit of testing, it seems like this happens if there are 2 Beaver Builder Tangible Template modules in a layout. When I substituted one of the modules with an HTML module using the Tangible Template shortcode, the logic inversion went away.

Thank you for reporting the issue. It sounds like the issue is caused by the interaction between the Template module and Beaver’s Conditional Logic, in particular how they get the current post (event in this case).

Every template gets its current post from its context. Every loop sets the current post to the current item in the loop, and when the loop is done, it restores it to what it was before the loop.

It seems that when the Template module is used more than once, it doesn’t restore the current post correctly - so after the second template, the conditional logic is checking the wrong post. Maybe.

Does the issue still happen if there is no Loop in the template? I would guess so, since it’s a taxonomy term loop, so it shouldn’t affect the current post.

Well, we’re looking into solving it.

@eliot I saw a change related to Beaver in the changelog for v4.1.3, is that to address this?

I couldn’t reproduce the issue but I added some logic to ensure that every instance of the Template module keeps a reference to the current post in context, then restores it after rendering the template. It was already supposed to be doing that though (internally called “push/pop current post context”) - so I’m not sure if it will make a difference.

@nadesignlab does the new update fix the issue for you?

Hello! Yes, this latest update seems to fix the issue. I now have two Tangible Beaver Builder modules in my Beaver Themer template and the conditional display logic is working as expected. Thanks!