CMS Development

fpena
Contributeur

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

Résolue

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 Votes
1 Solution acceptée
RMR
Solution
Participant

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

Résolue

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

Voir la solution dans l'envoi d'origine

2 Réponses
RMR
Solution
Participant

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

Résolue

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
Contributeur

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

Résolue

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 Votes