[dokuwiki] Re: Retrieving template from plugin JavaScript

  • From: Damien Regad <dregad@xxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 27 Feb 2021 00:13:15 +0100

Anyone ?


On 19/02/2021 01.01, Damien Regad wrote:

Greetings,

I need to use the current template in a plugin's script.js, but AFAIK
this information is not readily available.

My first idea was to use DOKU_TPL and extract the template name from the
path, e.g.

let template = DOKU_TPL.replace(/[\\/]$/, "").split(/[\\/]/).pop();

Then I wondered if it would not be better to export that from
$conf['template'] into JSINFO instead, as documented here
https://www.dokuwiki.org/devel:javascript#jsinfo

Thoughts / advice on the better approach would be appreciated.

Cheers
Damien



-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: