# Context Parameter

**URL:** <https://community.hubspot.com/t/context-parameter/78101>\
**Category:** CMS Development\
**Tags:** starter\
**Created:** [March 27, 2023, 5:05pm UTC](https://community.hubspot.com/t/context-parameter/78101 "2023-03-27T17:05:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcromero](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jcromero](https://community.hubspot.com/u/jcromero)\
**Post date:** [March 27, 2023, 5:05pm UTC](https://community.hubspot.com/t/context-parameter/78101/1 "2023-03-27T17:05:21Z")

</div>

Hello! Im trying to use the context parameter for my Practicum exercise for the developers certification and dont seem to be getting it right on how to use it. Here is how i set it up in my section template and then you can see it been used in my home page template…  
Thanks for the help!

 ![Screenshot 2023-03-25 at 12.43.46.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/b/4b6d168bc43a1585fd7bdc4e8fb48e2c8c1ebcf0.png)

 ![Screenshot 2023-03-25 at 12.44.15.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/8/083aa13ae4088cc22318857bd473ba6cc270c936.png)

---

<div class="post-metadata">

**Author:** ![jcromero](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jcromero](https://community.hubspot.com/u/jcromero)\
**Post date:** [March 27, 2023, 5:06pm UTC](https://community.hubspot.com/t/context-parameter/78101/2 "2023-03-27T17:06:29Z")

</div>

Ive already corrected the missing # from one but still not working

---

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [March 27, 2023, 6:55pm UTC](https://community.hubspot.com/t/context-parameter/78101/3 "2023-03-27T18:55:54Z")

</div>

Try

`background_color= {{context.background_color ||'#ccc'}}`

in your dnd\_section.  
You’ve also got a comma at the end there that might cause issue.

Likewise in your template, I’d remove the comma after “#fff” unless you’re adding more parameters.

Might not be the solution but it’s the first place I’d start.

* * *

 ![profile2022a.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7273a34ccfe3489fceebc8a36eca751481b59531.jpeg)

**Barry Grennan**

[Freelance HubSpot CMS Developer](https://www.seoanseo.ca?utm_source=HubSpotCommunity)

[Website](https://www.seoanseo.ca?utm_source=HubSpotCommunity) | [Contact](https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity) | [LinkedIn](https://www.linkedin.com/in/barrygrennan)

_Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges._

---

<div class="post-metadata">

**Author:** ![romerocam](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/romerocam/32/99172_2.png) [@romerocam](https://community.hubspot.com/u/romerocam)\
**Post date:** [March 28, 2023, 9:54pm UTC](https://community.hubspot.com/t/context-parameter/78101/4 "2023-03-28T21:54:57Z")

</div>

Hello Barry! Thanks for the answer but its still not working, any more thoughts on what im doing wrong? What else do i need to add up to have a context parameter working? Any extra setup?  
Thanks!

---

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [March 31, 2023, 2:51pm UTC](https://community.hubspot.com/t/context-parameter/78101/5 "2023-03-31T14:51:53Z")

</div>

Could you post your code? It’ll make it easier to troubleshoot

* * *

 ![profile2022a.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7273a34ccfe3489fceebc8a36eca751481b59531.jpeg)

**Barry Grennan**

[Freelance HubSpot CMS Developer](https://www.seoanseo.ca?utm_source=HubSpotCommunity)

[Website](https://www.seoanseo.ca?utm_source=HubSpotCommunity) | [Contact](https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity) | [LinkedIn](https://www.linkedin.com/in/barrygrennan)

---

<div class="post-metadata">

**Author:** ![jcromero](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jcromero](https://community.hubspot.com/u/jcromero)\
**Post date:** [March 31, 2023, 1:48pm UTC](https://community.hubspot.com/t/context-parameter/78101/6 "2023-03-31T13:48:57Z")

</div>

Hi Barry! thanks again for your answer! The section is showing and the path is actually section/section.html because i didnt use the boilerplate, just created it from scratch. Does the sections folder has to be named sections strictlly? If not, dont really know what else to do. Just did exactly what the certificate videos teach briefly about the context parameter. Is there any further documentation? havent find any att all.

---

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [March 30, 2023, 6:35pm UTC](https://community.hubspot.com/t/context-parameter/78101/7 "2023-03-30T18:35:01Z")

</div>

Is the section showing? I notice that the path you’re using is “../section/section.html”

If it’s the boilerplate you’re using this folder would be called sections.

When you view the code in Hubspot Developer Tools are there any errors/warnings?

* * *

 ![profile2022a.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7273a34ccfe3489fceebc8a36eca751481b59531.jpeg)

**Barry Grennan**

[Freelance HubSpot CMS Developer](https://www.seoanseo.ca?utm_source=HubSpotCommunity)

[Website](https://www.seoanseo.ca?utm_source=HubSpotCommunity) | [Contact](https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity) | [LinkedIn](https://www.linkedin.com/in/barrygrennan)

---

<div class="post-metadata">

**Author:** ![jcromero](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jcromero](https://community.hubspot.com/u/jcromero)\
**Post date:** [March 31, 2023, 8:15pm UTC](https://community.hubspot.com/t/context-parameter/78101/8 "2023-03-31T20:15:22Z")

</div>

Hi Barry! Here is the only code i have to link the context parameter. I have change the section folder to sections, just in case. So the path now is sections/section.html. The section is also displaying properly. Thanks in advance!

 ![Screenshot 2023-03-31 at 17.07.04.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/f/3f3091b9f6eaf4ece2082abf3bf6b1e09da6d173.jpeg)

 ![Screenshot 2023-03-31 at 17.06.25.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/e/fe74909dc5490eb2571e929455eaea185fae041d.jpeg)

---

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [March 31, 2023, 8:34pm UTC](https://community.hubspot.com/t/context-parameter/78101/9 "2023-03-31T20:34:10Z")

</div>

Sorry, I meant could you copy and pate your code so I can test it. Both the section code and the template code.

* * *

 ![profile2022a.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7273a34ccfe3489fceebc8a36eca751481b59531.jpeg)

**Barry Grennan**

[Freelance HubSpot CMS Developer](https://www.seoanseo.ca?utm_source=HubSpotCommunity)

[Website](https://www.seoanseo.ca?utm_source=HubSpotCommunity) | [Contact](https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity) | [LinkedIn](https://www.linkedin.com/in/barrygrennan)

---

<div class="post-metadata">

**Author:** ![jcromero](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jcromero](https://community.hubspot.com/u/jcromero)\
**Post date:** [March 31, 2023, 8:51pm UTC](https://community.hubspot.com/t/context-parameter/78101/10 "2023-03-31T20:51:12Z")

</div>

Dont worry! Here It is!  
Template:

\<!--  
templateType: page  
label: home page  
isAvailableForNewContent: true  
--\>  
\<!doctype html\>  
\<html\>  
\<head\>  
\<meta charset=“utf-8”\>  
\<title\>{{ content.html\_title }}\</title\>  
\<meta name=“description” content=“{{ content.meta\_description }}”\>

{{ require\_css (get\_asset\_url(‘../css/main.css’)) }}  
{{ require\_css (get\_asset\_url(‘../css/layout.css’)) }}  
{{ standard\_header\_includes }}  
\</head\>  
\<body\>  
\<div class=“page-wrap”\>  
{% block header %}  
{% global\_partial path=“./partials/header.html” %}  
{% endblock header %}

{% block body %}  
{% dnd\_area “dnd\_area” %}  
{% include\_dnd\_partial  
path=“../sections/section.html”  
context={  
“background\_color”: “#fff”  
}  
%}  
{% end\_dnd\_area %}  
{% endblock body %}

{% module “module\_16796047514203” path=“/foodie-theme/modules/foodie-pics”, label=“foodie-pics” %}

{% block footer %}  
{% global\_partial path=“./partials/footer.html” %}  
{% endblock footer %}  
\</div\>  
{{ standard\_footer\_includes }}  
\</body\>  
\</html\>  
and Section:

\<!--  
templateType: section  
label: Two- column content  
isAvailableForNewContent: true  
description: " Section separated in two columns with an image and text in each."  
--\>

{% dnd\_section  
background\_color= {{context.background\_color ||‘#ccc’}}  
%}  
{% dnd\_column  
offset=0,  
width=6%}  
{% end\_dnd\_column %}

{% dnd\_column  
offset=6,  
width=6%}  
{% end\_dnd\_column %}  
{% end\_dnd\_section %}
