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

SOLVE
Highlighted
Occasional Contributor
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.
Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
Occasional Contributor

It looks like the answer is:

{% set pageType = content.CMSContentType %}

2 Replies 2
Highlighted
Occasional Contributor

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?

Reply
0 Upvotes
Highlighted
Occasional Contributor

It looks like the answer is:

{% set pageType = content.CMSContentType %}