How do you set a master template for a partial view?
In my case, I want to create a layout file for a modal window, sort of an HTML overlay wrapper, and then have multiple partial views (modals) reusing the same wrapper (layout). So the partial view would only contain the inner content of the modal window. I need these partial views (modals) injected into my master template baseof.html.
I created the file and folder structure the way you suggested, but when I inject the “modal-1.html” into my template using {{- partial "modals/modal-1.html" . -}} it only renders the “modal-1.html” content (not wrapped with the “wrapper.html” code).
What do I need to specify in the “wrapper.html” to tell Hugo where to render my inner content, and how do I tell the “modal-1.html” to use “wrapper.html” as a layout?
You need to parameterize the call to the wrapper. Here’s an example:
git clone --single-branch -b hugo-forum-topic-38299 https://github.com/jmooring/hugo-testing hugo-forum-topic-38299
cd hugo-forum-topic-38299
hugo server