Using operators on contact properties in Webpage templates
SOLVE
Hi all,
I've run into something strange. I know this was something that's not possible in email templates, but it seems it's also an issue in other templates?
Basically, I want to be able to grab a certain property of the contact to determine interest and display a specific topic in a blog post, and if there's several, then it will display rows of different blog listings.
However, I've tried manipulating the value returned by hubspot with no success:
{% set string_to_split = contact.content_interests|string %}
{% set interests = string_to_split|split(',', 9) %}
{% for interest in interests %}
{% set post_listing = blog_recent_tag_posts(module.select_blog, interest|lower|replace(' ', '-'), 3 ) %}
{% for post in set post_listing %}
*display post*
{% endfor %}
{% endif %}
It seems the propeties obtained from *contact.property* cannot be compared or manipulated in anyway even though it's been copied to another variable?
I tested something like {% if contact.firstname == "firstname" %}
When you're testing {% if contact.firstname == "firstname" %}
I'm assuming you are using an actual first name value?
Maybe try using an if statment based on contact membership list? Create lists with contacts that filtered the topics they're interested in and see if that works.
When you're testing {% if contact.firstname == "firstname" %}
I'm assuming you are using an actual first name value?
Maybe try using an if statment based on contact membership list? Create lists with contacts that filtered the topics they're interested in and see if that works.
Using operators on contact properties in Webpage templates
SOLVE
Hmm I tried using list membership and it works, but then I would need to create lists conditions in the logic now for every topic available.
I.e before I was trying to get a contact's multi checkbox property to see if any values have been checked, but now, I will need to hardcode each list condition in:
{% if 15 in request_contact.list_membership %}
* generate listing for this list here *
{% endif %}
which isn't really feasible for a client to do every time they want a new listing.