# Set button options at template level

**URL:** <https://community.hubspot.com/t/set-button-options-at-template-level/74117>\
**Category:** CMS Development\
**Tags:** design-manager\
**Created:** [January 31, 2023, 10:28am UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117 "2023-01-31T10:28:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![InciteJoe](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/incitejoe/32/9373_2.png) [@InciteJoe](https://community.hubspot.com/u/InciteJoe)\
**Post date:** [January 31, 2023, 10:28am UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/1 "2023-01-31T10:28:49Z")

</div>

I am creating a template that uses buttons that jump down to the form, the form section has an anchor id of “contact”

How can I set the button settings at template level to set the button options to “Use as link” then the button link to be #contact?

The below is my current button module settings

{% dnd\_module  
path=“../modules/button”,  
button\_text=“Add button text”  
%}

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 31, 2023, 8:09pm UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/2 "2023-01-31T20:09:02Z")

</div>

Hi, @InciteJoe, thanks for the question! One question for context, are you getting an error when trying your current approach? I am hoping we can help give the community more details to work with.

Hey, @BarryGrennan, do you have any tips you can share with @InciteJoe?

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![InciteJoe](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/incitejoe/32/9373_2.png) [@InciteJoe](https://community.hubspot.com/u/InciteJoe)\
**Post date:** [January 31, 2023, 9:52pm UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/3 "2023-01-31T21:52:59Z")

</div>

Thanks [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074), @BarryGrennan managed to help me

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 31, 2023, 9:55pm UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/4 "2023-01-31T21:55:07Z")

</div>

That’s great to know, @InciteJoe! Thank you, @BarryGrennan 🙌

---

<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:** [January 31, 2023, 8:33pm UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/5 "2023-01-31T20:33:15Z")

</div>

Thanks for the tag [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074)!

Hi @InciteJoe, assuming your button module is from the boilerplate you’d do it like this:

```lia-code-sample
 {% dnd_module
path="../modules/button",
button_text="Add button text",link={"url":{"href":"#contact"}}
 %} 

```

* * *

 ![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:** ![InciteJoe](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/incitejoe/32/9373_2.png) [@InciteJoe](https://community.hubspot.com/u/InciteJoe)\
**Post date:** [January 31, 2023, 10:05pm UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/6 "2023-01-31T22:05:52Z")

</div>

Hi @BarryGrennan

Sorry I just tried it using this

{% dnd\_module  
path=“../modules/button”,  
button\_text=“Add button text1”,  
link={“url”:{“href”:“#contact”}}  
%}

But the output I get from that is this

\<button class=“button” id=“button\_dnd\_area-module-32” rel=“”\>Add button text1\</button\>

---

<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:** [January 31, 2023, 11:26pm UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/7 "2023-01-31T23:26:26Z")

</div>

@InciteJoe it looks to me like that button module isn’t from the boilerplate (at least the version I’m using) as the boilerplate outputs an anchor tag with a hs-button class rather than a button tag as yours does.

Can you post the content of the html area in your button module? It’ll give me a clue to what the url field is called

* * *

 ![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:** ![InciteJoe](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/incitejoe/32/9373_2.png) [@InciteJoe](https://community.hubspot.com/u/InciteJoe)\
**Post date:** [February 1, 2023, 9:02am UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/8 "2023-02-01T09:02:12Z")

</div>

Sorry about that @BarryGrennan I am using the free Hubspot “Session theme” and I didn’t realise that it has a modified button module

It looks like it has a field group called “button\_options” then a field within this called with a field called “button\_link\_toggle” with is a Boolean and then it just has the field called “button\_link” which is a link field

---

<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:** [February 1, 2023, 2:12pm UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/9 "2023-02-01T14:12:40Z")

</div>

Just had a look at Session theme.

I think what you’ll want to do is something like this:

```lia-code-sample
{% dnd_module
path="../modules/button",
button_text="Add button text1",
button_options={"button_link_toggle": true},
button_link={"url":{"href":"#contact"}}
%}

```

* * *

 ![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:** ![InciteJoe](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/incitejoe/32/9373_2.png) [@InciteJoe](https://community.hubspot.com/u/InciteJoe)\
**Post date:** [February 1, 2023, 2:28pm UTC](https://community.hubspot.com/t/set-button-options-at-template-level/74117/10 "2023-02-01T14:28:21Z")

</div>

Thanks @BarryGrennan that works perfectly!
