CMS Development

Tornike
Participant

Problem while adding modules using snippets

SOLVE

 Hello everybody,

 Need your help here...

 One problem that I have is that I am trying to include html module in another html module (Not Drag&Drop) Hubspot says:

"This module can be added to any drag and drop template via the Add sidebar. It can be added to HTML/HubL templates using the following snippet" and gives me usage snippet...

  

When adding this thing errors happen:

 
 -- Cannot resolve property "module"
 -- 'module' is disabled in this context
 
What am I doing wrong?...
 
And one other question:
 
If I try to locate a module inside a module like this, how do I make so that when editing a template of this website, this module had an option of adding multiple module of this kind ? 
Thanks a lot 

 

0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Problem while adding modules using snippets

SOLVE

Hey @Tornike 

 

So it seems that even though the official documentation says that using modules inside of other modules is a supported function, the error  "'module' is disabled in this context" and older community posts are showing that this is no longer the case.

 

So a potentially grueling solution would be to mimic the 'child' module's authoring experience (data input), functionality, and markup/styling into the 'parent' module.

 

EDIT:

I said grueling but if structured correctly this could lead to a much more fluid and effecient authoring experience!

 

If the purpose of embedding modules in modules was to share a variable, I would take a look at export_to_template_context as this could be the parameter thats saves you a lot of time.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

5 Replies 5
elanashama
Top Contributor

Problem while adding modules using snippets

SOLVE

Can someone provide the code that works? 

0 Upvotes
DanielSanchez
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Problem while adding modules using snippets

SOLVE

Hi @Tornike ,

 

You has copy the snippet of module to paste in another? In your module, copy the snippet to paste where you need in your template. Look:

 

templates (1).PNG

 

Did this post help solve your problem? If so, please mark it as a solution.

Best regards!

0 Upvotes
Tornike
Participant

Problem while adding modules using snippets

SOLVE

Thanks for response Daniel, 

That's what I am trying to do, copy that snippet which you indicated and then paste it in another module. It causes the error which I mentioned above.

I'm looking for ways to make this work and get rid of the error...

Any ideas?...

Oh and happy new year btw  : )

0 Upvotes
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Problem while adding modules using snippets

SOLVE

Hey @Tornike 

 

So it seems that even though the official documentation says that using modules inside of other modules is a supported function, the error  "'module' is disabled in this context" and older community posts are showing that this is no longer the case.

 

So a potentially grueling solution would be to mimic the 'child' module's authoring experience (data input), functionality, and markup/styling into the 'parent' module.

 

EDIT:

I said grueling but if structured correctly this could lead to a much more fluid and effecient authoring experience!

 

If the purpose of embedding modules in modules was to share a variable, I would take a look at export_to_template_context as this could be the parameter thats saves you a lot of time.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
Kevin-C
Recognized Expert | Partner
Recognized Expert | Partner

Problem while adding modules using snippets

SOLVE

@Tornike 

 

Could you provide us with any code that you've tried thus far?

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes