APIs & Integrations

darrengates
Membre

HubL variable to determine if a page is a website page or a landing page

Résolue
Is there a HubL variable that allows me to determine whether a page is a "website" page or a "landing" page or "blog" page? For example:
 
this page is of type = {{page_type}}
 
the output would be something like:
 
this page is of type = landing_page
 
The reason for this is I'm hoping to use a single header partial for both, so that I don't have to update css and page structure twice when design gets updated.
0 Votes
1 Solution acceptée
darrengates
Solution
Membre

HubL variable to determine if a page is a website page or a landing page

Résolue

It looks like the answer is:

{% set pageType = content.CMSContentType %}

Voir la solution dans l'envoi d'origine

2 Réponses
darrengates
Membre

HubL variable to determine if a page is a website page or a landing page

Résolue

Follow up: I discovered that if I do the following in a template, it shows me a large string containing "CMSContentType=Optional[LANDING_PAGE]" 

 

I'm thinking that if I can stringify the "content" variable, and do a simple string search for the above substring, that might be one way to do this. 

 

Question is: how do I stringify an object in HubL, and also how do I search that string for a substring?

0 Votes
darrengates
Solution
Membre

HubL variable to determine if a page is a website page or a landing page

Résolue

It looks like the answer is:

{% set pageType = content.CMSContentType %}