Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template script.js does not work #3

Closed
selfthinker opened this issue May 29, 2011 · 4 comments
Closed

Template script.js does not work #3

selfthinker opened this issue May 29, 2011 · 4 comments
Labels

Comments

@selfthinker
Copy link
Owner

As reported by Jan Kreps 2011/03/16 12:38 on http://www.dokuwiki.org/plugin:loadskin#template_scriptjs_does_not_work_without_doku_tplinc :

I noticed small trouble with javascript loading. All lib/tpl//script.js should be loaded at the start. But because I commented out part of init.php definig DOKU_TPLINC as suggested, script.js in template directory does not get loaded. It's because DOKU_TPLINC constant is needed when list of scripts to include is generated. It is in lib/exe/js.php in function js_out().

@selfthinker
Copy link
Owner Author

Since DOKU_TPLINC has been deprecated, things have changed a bit (see dokuwiki/dokuwiki@c476695 and dokuwiki/dokuwiki@81aca18).

I have just tried to fix it, but found the following problems:

  • When setting the template by anonymous user, that template preference is set in the session. There is no session in lib/exe/js.php, so this won't work.
  • When setting the template by logged-in user, that template preference is set in a config file, but to get the logged-in user, you need the session again. So, no luck here as well.
  • When setting the template by namespace, the $ID is necessary for that (to check which namespace is viewed). But as the $ID is not available in lib/exe/js.php, this also won't work.

So, with the current existing solutions it's not possible to make a template's script.js work. This needs either some changes in the core or some clever new solution I couldn't think of yet.

@selfthinker
Copy link
Owner Author

I found a solution, but only by changing the core, see dokuwiki/dokuwiki#1130.

@selfthinker selfthinker changed the title Template script.js does not work without DOKU_TPLINC Template script.js does not work May 4, 2015
@selfthinker
Copy link
Owner Author

This is now fixed in the current development version of the core DokuWiki.
But I will keep this issue open until a new stable release is out.

@selfthinker
Copy link
Owner Author

As there is a new release of DokuWiki now, this can finally be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant