Solved

Show/Hide logic with new template editor not working


Badge +1

Hello. 

 

I’m struggling with getting the following thing to work. 

I need to make a template using the new editor because it has some features that I need to make the design work. Additionally I need to port the show/hide logic for some blocks. 

So for the old template editor the condition was like this : 

person|lookup:'custom_prop'|lookup:0 != '<missing>'

The “custom_prop” is a property that I set on profile and it is a list. It is set by a script integrated with the api, and there’s some logic that inserts “<missing>” at position 0 in some cases.

Now this logic won’t work in the new editor - the block is displayed even though the 0 element of the “custom_prop” list is set to “<missing>”. 

I’ve tried rewriting this in several ways : 

not ‘<missing>’ in person.custom_prop

‘<missing>’ not in person.custom_prop

‘<missing>’ != person.custom_prop.0

{{ person|lookup:'custom_prop'|lookup:0 != '<missing>' }}

not '<missing>' in person|lookup:'custom_prop'

 

Nothing works. Could somebody please give me some hints on what the correct syntax would be in this case ? I’m using the preview feature of the new editor along with setting the correct profile to check this by the way.

icon

Best answer by maciekw 4 July 2022, 14:54

View original

2 replies

Userlevel 7
Badge +60

Hello @maciekw,

Welcome to the Klaviyo Community!

Our Senior Email Template Designer, @Anna McCarthy actually offered a great rundown of using the Show/Hide functionality within the new editor. I would suggest taking a look at the video tutorial she offers in the her post which I’ve linked below:

In addition to our How to show or hide template blocks based on dynamic variables Help Center article, @retention also has a great blog article they created that could be useful to reference as well: How To Set Show/Hide Blocks Based On A Custom Profile Property

I hope this helps!

David

Badge +1

Ok, the links didn’t really help as I’ve already tried all solutions mentioned there. 

What works is changing the property “<missing>” to “missing” - for some reason conditional logic won’t match the “<” and “>”.

Reply