How to set a layout for a partial view?

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

Look at:

  • layouts/_default/home.html
  • layouts/partials/modals/wrapper.html
  • layouts/partials/modals/modal-1.html

Related: