Trying to create a module and include a snippet (partial) into the module to keep the code segmented and easily manageable -- it throws the error stated in the subject "include" is disabled in this context but it still seems to work just fine.
Is this something to be concerned about? As in will the be deprecated in future updates? Or something similar -- just curious if I should avoid this method even though it seems to currently work
Matthew Scott Head of Development | Hubspot Solutions Architect
B2B marketing agency: Specialist B2B content marketing and demand generation for SaaS vendors and HubSpot Users | Deeply Digital | HubSpot Partner since 2010
Matthew Scott Head of Development | Hubspot Solutions Architect
B2B marketing agency: Specialist B2B content marketing and demand generation for SaaS vendors and HubSpot Users | Deeply Digital | HubSpot Partner since 2010
I didn't actually read as far as the from function that's pretty cool, thanks for pointing that one out! I actually had my individual macros spread out and then imported into my macros.html something like this:
{% import "./components/_cta.html" as _cta %}
{% set cta = _cta.cta %}
{% import "./components/_form.html" as _form %}
{% set form = _form.form %}
{% import "./components/_image.html" as _image %}
{% set image = _image.image %}
{% import "./components/_intro.html" as _intro %}
{% set intro = _intro.intro %}
but now I can update it to use the from function so I don't have to do the additional sets
Matthew Scott Head of Development | Hubspot Solutions Architect
B2B marketing agency: Specialist B2B content marketing and demand generation for SaaS vendors and HubSpot Users | Deeply Digital | HubSpot Partner since 2010
Hi, @KSchuller👋 Can you provide any additional details to help the community? A code snippet of what you've already tried along with screenshots will help give more context to potential root causes.
To your second question, I do not have any documentation internally or via the public developer docs indicating depreciation of this functionality (partials)
So in a custom module that I'm making I've got a partial HTML file that I include in the module, like so
{% include '../templates/partials/vidyard-new.html' %}
And this will throw the following message in the error console
Warning: "include" is disabled in this context
However the include does work despite this message. Which is why I just wanted to confirm it will continue to work -- I can of course include the code directly in the module but the module itself is already 1200+ lines of code so I'm looking to use snippets to make it all easier to manage