HubL If Statements

SOLVE
Highlighted
Occasional Contributor

Hello everyone,

 

Is there a HubL if statement that would display content based on the URL. What I'm trying to accomplish is having a dynamic content section in the sidebar. I'd like to know if there is another way to do this as well.

 

Thank you for the help!

Cenker

Reply
0 Upvotes
2 Accepted solutions

Accepted Solutions
Community Superstar


2000px-Ok_sign_font_awesomeDoes my post help answer your question?

Help the Community by marking it as SOLVED

 

Q: Is there a HubL if statement that would display content based on the URL?

 

Short A: see Solved: Display information based on url factors?

 

share-on-Linkedin-Button-75x19.png 


Your Remote HubSpot Partner

www.MFrankJohnson.com

 

Please include @MFrankJohnson in your message if you'd like me to reply.

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817

Reply
0 Upvotes
Community Superstar

Hey @cinanoglu,

 

Here are a couple more resources that should clear it up for you ...

- see Personalization based on query string data

- see HTTP request variables

 

You'll have more success on the HubSpot Developers Forum for Hubl questions like these.

 

Hope that helps.

 

Best,

Frank

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817

Reply
0 Upvotes
5 Replies 5
Community Superstar


2000px-Ok_sign_font_awesomeDoes my post help answer your question?

Help the Community by marking it as SOLVED

 

Q: Is there a HubL if statement that would display content based on the URL?

 

Short A: see Solved: Display information based on url factors?

 

share-on-Linkedin-Button-75x19.png 


Your Remote HubSpot Partner

www.MFrankJohnson.com

 

Please include @MFrankJohnson in your message if you'd like me to reply.

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817

Reply
0 Upvotes
Occasional Contributor

Hello @MFrankJohnson,

 

Thanks for sharing the thread.

 

I'm still confused about how to use this statement;

 

{% if request.query_dict.utm_campaign == "something" %}

 

Let's say I have a campaign called "Smart Content", what should I change "something" with?

 

Thank you!

Reply
0 Upvotes
Community Superstar

Hey @cinanoglu,

 

Here are a couple more resources that should clear it up for you ...

- see Personalization based on query string data

- see HTTP request variables

 

You'll have more success on the HubSpot Developers Forum for Hubl questions like these.

 

Hope that helps.

 

Best,

Frank

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817

Reply
0 Upvotes
Occasional Contributor

Hello @MFrankJohnson,

 

Thank you so much! I modified the code with;

 

{% if request.path == "/xxx" %}  and it works just fine.

 

Have a great rest of your day!

Community Superstar

Excellent @cinanoglu. Gotta say, that's a lot easier than anything I've ever done in WordPress or .js! haha

 

Thanks for circling back with your success story. It helps others see value in the HubSpot Community.

 

Best,

Frank

Hope that helps.

 

Best,
Frank

 

MFrankJohnson-dot-com-HubSpot-Community-banner-gif-v20190817