DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy

tips:css_selector_namespace

If you want to target specific namespaces with CSS, you can use a conf/userscript.js-trick as explained here:

/* add namespace for CSS-selection, https://github.com/splitbrain/dokuwiki/issues/2531#issuecomment-679170765 */
jQuery( 'body' ).attr( 'data-page-namespace', JSINFO.namespace );

For example, if you want all pages in a namespace named public: to have a custom background image, you can use the following CSS-rule. Note that the background image background-namespace-public.jpg is located in the user configuration folder for the template with name my-template-name.

/* custom background for pages in namespace 'public:'*/
body[data-page-namespace="public"] {
   background: no-repeat top/cover url('conf/tpl/my-template-name/background-namespace-public.jpg');
}
tips/css_selector_namespace.txt · Last modified: 2020-08-26 10:56 by pelel