Context: I am trying to get my next.js project into a cms using hubspot local cevelopment CLI - and specifically the cms-react-boilerplate: see here
I am trying to wrap my head around how I would be able to create multiple modules that are accessable in cms within this boiler plate setup. Unless I do not understand it properly, it seems like with the cms boilerplate you can upload your react app - but I have not been able to work out how to create multiple modules out of of my react components/modules. For example I have a hero module, nav, footer, carousel… and I want each of them to be a seperate module on hubspot that I can drag and drop onto pages.
[
TommyPet Spain
I am trying to replicate the structure of app.module to create more modules - but it seems like its routed so that only app.js is whats being rendered up onto hubspot?
{{ require_css(get_asset_url('../../main.css')) }}
{{ require_js(get_asset_url('../../main.js'), 'footer') }}
{%- set instance_id = name %}
<div class="cms-react-boilerplate">
<script type="application/json"
data-module-instance="{{ instance_id }}"
data-portal-id="{{ portalId }}">
{{ module|tojson }}
</script>
<div id="App--{{ instance_id }}"></div>
</div>
In the above - what I want to know is the significance of instance_id and can I change this is new modules and somehow have it render my new modules? For example if I made a hero.module and the instance_id was set to hero how do I configure this so that its a seperate module?
I hope this is clear enough. I basically want to know how I create new modules within this boiler plater that link to my React modules/components.
Thanks.