Okay! Here’s the situation. I’m building a set of templates, and I’m using the new design manager beta (which I love, by the way). I’m creating modules at the upper level, to make it easy for our content people to edit, but I have smaller shared elements that I’m not totally sure how to handle.
There’s a little box with an icon (a little play icon) and some text (needs to be editable -- it’s a timestamp in some places, the words “Now Playing” in another, etc). It has fairly specific markup and CSS needed (for the sake of the argument, let’s say the icon animates). I’m calling it a “Video Flag”.
My first thought was to use the new module system and make this Video Flag a module, so that the CSS is attached to the markup. However, when I tried to include the Video Flag module inside another module (“Videos List”), I got the error that
"module" is disabled in this context
So, fine. My next thought was to create a Macros file, and create the Video Flag markup as a macro (at that point, I’d given up on keeping the CSS with it -- I can add that to the stylesheet for all the pages if I have to, although if there’s a way to keep them all together I’d be excited about that). I figured I could probably import the template with the macros into my module HTML, but no luck there either --
"import" is disabled in this context
SO. I can create the macro directly at the top of the module, but I also want to use it in another module on the same page, and I don’t want to define it twice if I don’t have to. I tried defining the macro in the index.html file, for use in the modules, but that didn’t seem to work either.
What’s the best way to approach this? It seemed like nesting modules would be the best solution, but hubl doesn’t want me to do that. I could also just do the obvious thing, and write the dang code in both modules, but that’s not fun
![]()
