CMS Development

fpena
Contributor

Create content variable that can be accessed via drag and drop design

SOLVE

I've been trying to research this problem but still haven't come up with a workable solution. 

 

We have rates on our site that change regularly. What I've been having our users do is go in and change them manually throughout the various pages. Obviously that opens us up for mistakes and is very inefficient. 

 

All I want to do is define a value in a central location and have my users be able to pull that value when creating a template. The users though are not very proficient in HTML so if we just need to have them change something already existing then fine, but if it requires continual code change then I'd rather make use of the drag and drop feature. 

 

Is this possible in Hubspot? How would I go about it? 

 

For example I have a headline on one of our landing pages that states, "This product now costs $XYZ". The value of XYZ would be defined in a table and would then pull and populate across all pages that use the XYZ variable. And this variable would be easily accessible to users who just use the drag and drop design manager. 

 

How can I do this? 

 

Thank you!

0 Upvotes
1 Accepted solution
RMR
Solution
Participant

Create content variable that can be accessed via drag and drop design

SOLVE

Hey @fpena,

 

I'm not sure if this is officially supported, but how about defining your variable in Content Settings > Site header HTML, like this:

 

2018-03-vkjy2.png

 

 

{% set price = "$120" %}

 

(it would probably be better to use a more complex name for your variable to avoid any conflicts)

 

Then use the variable in your content (Custom HTML, HubL, Custom Module, probably lock the module):

 

 

<h1>This product now costs {{ price }}</h1>

 

 

You can teach them how to update this in Content Settings. It should be pretty easy.

 

I've just tested this and it seems to work:

 

2018-03-0i8u0.png

 

Hope this helps.

 

Thanks,

-Radu

View solution in original post

2 Replies 2
RMR
Solution
Participant

Create content variable that can be accessed via drag and drop design

SOLVE

Hey @fpena,

 

I'm not sure if this is officially supported, but how about defining your variable in Content Settings > Site header HTML, like this:

 

2018-03-vkjy2.png

 

 

{% set price = "$120" %}

 

(it would probably be better to use a more complex name for your variable to avoid any conflicts)

 

Then use the variable in your content (Custom HTML, HubL, Custom Module, probably lock the module):

 

 

<h1>This product now costs {{ price }}</h1>

 

 

You can teach them how to update this in Content Settings. It should be pretty easy.

 

I've just tested this and it seems to work:

 

2018-03-0i8u0.png

 

Hope this helps.

 

Thanks,

-Radu

fpena
Contributor

Create content variable that can be accessed via drag and drop design

SOLVE

Radu, 

 

Thank you so much as that worked PERFECTLY! 

 

As you said I'm not sure if it is supported or not but at least initially it appears to do exactly what I'm asking it to. 

 

I appreciate your response and the examples you provided as I knew precisely where to go to make the changes.

 

Thanks again!

Fernando

0 Upvotes