CMS Development

simon_b
Member

Pull data from one custom module into another custom module

Hi, I'm building an email template in design manager and I currently have a few custom modules that feature identical choice field options. I'd like to create 1 custom module with choice field options and pull it into other custom modules. Is this possible?

 

Thanks!

0 Upvotes
4 Replies 4
roisinkirby
HubSpot Product Team
HubSpot Product Team

Pull data from one custom module into another custom module

Hello @simon_b welcome to the Community! I've not personally seen this done before, bu this would not be my area of expertise. @ndwilliams3 do you know if this is possible?

0 Upvotes
ndwilliams3
Key Advisor

Pull data from one custom module into another custom module

Each custom module added to a page has a unique ID. You can access the vairables for that module, but would need to know the id for that page instance. This makes it very problematic to do programatically.  I've found a few work arounds within Design Manger.  Give me some  specific details on the use case i can play around with it and see if there's a potential work around.

simon_b
Member

Pull data from one custom module into another custom module

Hi @ndwilliams3, thanks for your reply!

 

To give you some specifc details... I work for a travel/tour company and display featured holidays in our emails which include: maps, departure cities, holiday duration, tour names, page urls etc.

 

I have buillt a few templates for various audiences (eg b2b, b2c) and have ended up building near identical custom modules. The issue being some of the fields in the custom modules have long choice lists and when updates are required it's a repetitive/time consuming job to bring them all up to date.

 

So, I trying to find a way to build a custom module that simply includes page urls, for instance, that I can then import into other custom modules - so when I need to update anything I only need to do it once.

 

I have briefly looked into embedding module IDs but I haven't managed to get this to work yet - have tried using {% module "module_###" module_id="###" label="example_custom_template" %} however each parameter creates an error, so can't be saved 😞

 

Thanks again,

Simon

0 Upvotes
ndwilliams3
Key Advisor

Pull data from one custom module into another custom module

I'm realizing this is not possible with the new design manager! It was with the old version. We have multiple brands under our parent company, so I have HUBL code with a choice option. Based on the choice, it loads a gobal image module with the logo for the brand as well as CSS variables for colors, phone number, etc. It seems you can't load a global module in a custom module with V2. There's also no longer a default HUBL module and you can't add HUBL to the HTML module. I can't find any work arounds at the moment! My old V1 module is still working, at least for now. Any suggestions?