CMS Development

John
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

If Statement for Email or Page

SOLVE

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 %}


I like kudos almost as much as cake – a close second.

0 Upvotes
1 Accepted solution
benvanlooy
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

If Statement for Email or Page

SOLVE

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 | Platinum Partner
Top Contributor | Platinum Partner

If Statement for Email or Page

SOLVE

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.

John
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

If Statement for Email or Page

SOLVE

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. 



I like kudos almost as much as cake – a close second.

0 Upvotes
BiG
Contributor

If Statement for Email or Page

SOLVE

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