If Statement for Email or Page

SOLVE
John
Top Contributor | Platinum Partner

Is there a way to check if the user is using a module on an email or a landing/webpage?

 

For example:

{% if webpage %}
    xyz
{% elif email_template %}
    pdq
{% endif %}


Will you please help the community and give me some street cred by marking my answer as a solution if helped you? I'm fixing to buy a minivan and my cool points are running low.

Curious cats can find me at Ascend Inbound Marketing

0 Upvotes
1 Accepted solution

Accepted Solutions
benvanlooy
Solution
Top Contributor | Gold Partner

I'm not sure but I would assume that that type of info you could find the developers info.

 

Check out this post:

https://designers.hubspot.com/docs/hubl/how-to-use-developer-info-on-cos-pages

 

It's quite possible you'll find a reference to which type of page  you are on and then you can use the conditional statements to do what you like depending of the type of page.

View solution in original post

3 Replies 3
benvanlooy
Solution
Top Contributor | Gold Partner

I'm not sure but I would assume that that type of info you could find the developers info.

 

Check out this post:

https://designers.hubspot.com/docs/hubl/how-to-use-developer-info-on-cos-pages

 

It's quite possible you'll find a reference to which type of page  you are on and then you can use the conditional statements to do what you like depending of the type of page.

View solution in original post

John
Top Contributor | Platinum Partner

Thank you, I dug around and found a couple of things for anyone else who is interested.

 

HubSpot has data some data types. So far for drag and drop lp's I have found

{{ template_meta.template_type }}

For Landing Pages created via drag & drop editor

{
  "template_meta": {
    "template_type": 4
  }
}

For blog pages via template editor

{
  "template_meta": {
    "template_type": 6
  }
}

I am curious to know what the other values represent. 



Will you please help the community and give me some street cred by marking my answer as a solution if helped you? I'm fixing to buy a minivan and my cool points are running low.

Curious cats can find me at Ascend Inbound Marketing

0 Upvotes
BiG
Contributor

This feature is currently not implemented.

 

We added the query to have "HUBL if's for emails" to the ideas here in the forum.

 

If you agree that this feature is needed, please support this idea which queries for if statements in HUBL for emails:
https://community.hubspot.com/t5/HubSpot-Ideas/if-statements-in-email-templates/idi-p/282907

0 Upvotes