I have a template that I use for ~20 different pages. On each of these pages, there is a paragraph of shared content (global module) that I would like to customize, depending on the page used. Ex: replace {{ this_text }} with “page 1” or “page 2” or “page 3”, depending on the page where the module is used.
I am comfortable with using variables at the template level. Is there any way to do it at the page level?
Hi @wmflan39,
Global Module cannot be customization on every page level mode. if you want to change content on every page then you have to use a custom module instead of global module
Thanks
Thanks TRooInbound for the reply. I was afraid that might be the only way to do it.
wmflan39
Hi @wmflan39,
can I get you page URL for understanding better?
We have pages for each of ~20 heating processes (brazing, annealing, forging, soldering, etc.) offering application notes for each. Below that is a literature offer (global module ‘About Induction Heating’) I place on each of these ~20 pages. To avoid any ‘duplicate content’ concerns, I was thinking of a way to use a variable to insert the appropriate process name in the body of the paragraph, depending on the page the global module is used.
An example: Induction Melting
wmflan39
@wmflan39
Yes, you can use variables in global module
I’ve created demos for you,
create one template in HubSpot using the global module and publish 2 pages using this and change global module content successfully on this.
Like this,
this is the code you have to put in,
{% text "my_title" label='Enter a title', value='About Induction Heating', export_to_template_context=True %}
<h2>{{ widget_data.my_title.value }}</h2>
I’ve created this two links,
http://testhub-3895366.hs-sites.com/troo-test-01
http://testhub-3895366.hs-sites.com/trootest-02
Thanks,
Team TRooInbound
Troo,
I’m at the end of a long day. I will study this tomorrow.
Thank you very much for taking the time to show me this.
wmflan39
@wmflan39 Cool, cheers
For more help please visit at trooinbound.com or email at hello@trooinbound.com