Since "Configuration Setting: htmlok" is considered a "big security risk" I use a different approach with Javascript. However, this works for admins only, because you need write access to dokuwiki/conf/userscript.js
.
If you want to create a new page with embedded HTML, at the least, you need to add a simple <h1> header to the empty page, like so: ====== My Page ======
. That's all for the page!
If dokuwiki/conf/userscript.js
does not yet exist, create it. Add the following, including your HTML code:
jQuery( "h1#my_page" ).after(
"<div id='my_div'> My Div </div>" +
"<p class='my_p'> new line </p>" +
"<p class='my_p'> new line </p>" +
"<p class='my_p'> new line </p>" +
"<p> new line </p>" +
"<p> new line </p>"
);
Beware, not to mix up the outer quotation marks " " with the inner quotation marks ' ' which can be used for everything inside of your HTML code, if needed! (I know, in my example the single marks could be omitted, altogether.)
You can style your content by adding CSS styles to dokuwiki/conf/userall.css
, like so:
div#my_div { height: 20px; width: 100%; background-color: red; }
p.my_p { color: red; }
Finally, you could even hide the original page header:
h1#my_page { display: none; }
There you go! Cheers!