Dokuwiki does not have the notion of template by page. You can’t apply a layout for a dedicated page.
It offers by default to disabled the toc and that’s all.
The template is for the whole website. There are plugins that permits to switch from template.
As I found it cumbersome to create a whole dokuwiki template just for a layout, I created a template system by page.
In the holy template, the toc is at the right. In a medium template the toc is below the heading.
https://combostrap.com/theme/what-is-a-template-z9tl87hg
Becareful with the combo plugin, this is a all-in-one plugin
If you have some php notion, the best is to tweak a dokuwiki template to your needs.
May be there is a better way to manage a layout.
This is the big difference I think between a cms and a wiki.