Skip to content

Commit 4b676a6

Browse files
New handling of /user files (-> *.dist files for easier updates)
I provided two separate archives until now: One for installation, one for update. The only difference between them was that the update archive did not contain the /user sub-directory to keep use-defined changes. However, this was too complicated for many users as only my templates were delivered with as two separate archives. So I changed my mind and use /user/*.dist files to provide examples and templates. These files are dummies and may be overwritten. However, the user can take and just remove the ".dist" extension to use them as starting point for own modifications.
1 parent e76c447 commit 4b676a6

File tree

10 files changed

+115
-90
lines changed

10 files changed

+115
-90
lines changed

README

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,59 +33,70 @@
3333
these hints for customizing the template:
3434

3535
- Place your files in "prsnl10/user"
36-
The place for *all* userdefined, custom stuff is "prsnl10/user".
37-
Reason: this folder will not be touched on updates. Therefore you may
38-
delete everything except "prsnl10/user" and copy all new files into
39-
"prsnl10/" to update without loosing your changes. Do not forget to
40-
empty your browser's cache afterwards.
36+
The place to store *all* user-defined, custom stuff is the "prsnl10/user"
37+
directory because your files will not be touched or overwritten on
38+
template updates! So you normally can copy all new files into "prsnl10/"
39+
to update the template without loosing your changes.
40+
Note: There are example files helping you modifying the template.
41+
The are delivered with the ".dist" extensions. Just remove the
42+
".dist" extension to use them.
4143

4244
- Own logo
43-
If you want to replace the default text showed in the headline, simply
44-
create a "logo.[png|gif|jpg]" in "prsnl10/user". The template recognizes
45-
the file automatically and will use it instead of the default text. Do not
46-
forget to empty your browser's cache afterwards.
45+
If you want to replace the default logo showed in the upper left, simply
46+
create a "logo.[png|gif|jpg]" in "monobook/user". The template recognizes
47+
the file automatically and will use it instead of the default text.
48+
Note: Do not forget to empty your browser's cache if you cannot see any
49+
effect.
4750
Hint: If you want to use a text-based logo, you might find the font
4851
files [1] for "Droid Sans" out of Google's Webfont Directory [2]
4952
useful.
5053

5154
- Own favicon
5255
If you want to replace the default favicon, simply create a "favicon.ico"
5356
in "prsnl10/user". The template recognizes the file automatically and
54-
will use it instead of the default one. Do not forget to empty your
55-
browser's cache afterwards. By the way: you might find the online
56-
FavIcon Generator [3] useful.
57+
will use it instead of the default one. You might find the online FavIcon
58+
Generator [3] useful.
5759
Note: "favicon.png" is also possible but not recommended (because it is
5860
not supported by older MSIE versions).
5961

6062
- Own CSS
61-
To apply additional CSS rules, edit "prsnl10/user/screen.css"
62-
(influences normal layout) and/or "prsnl10/user/print.css" (influences
63-
print layout) and/or "prsnl10/user/rtl.css" (influences "right-to-left"
64-
languages like Hebrew). These files will be included automatically (as the
65-
last ones for the relevant media, therefore you are able to overrule
66-
existing styles). Do not forget to empty your browser's cache afterwards.
63+
To apply additional CSS rules, create a
64+
- "prsnl10/user/screen.css" file to influence the normal layout. You
65+
can rename the "screen.css.dist" to "screen.css" as starting point.
66+
- "prsnl10/user/print.css" file to influence the print layout. You
67+
can rename the "print.css.dist" to "print.css" as starting point.
68+
- "prsnl10/user/rtl.css" file to influences "right-to-left" languages
69+
like Hebrew. You can rename the "rtl.css.dist" to "rtl.css" as
70+
starting point.
71+
The file(s) will be included automatically (as the last ones for the
72+
relevant media, therefore you are able to overrule existing styles).
73+
Note: Do not forget to empty your browser's cache if you cannot see any
74+
effect.
6775

6876
- Own JavaScript
69-
To load additional JavaScript, edit "prsnl10/user/user.js". Do not
70-
forget to empty your browser's cache afterwards.
77+
To load additional JavaScript, create a "prsnl10/user/user.js" file. You
78+
can rename the "user.js.dist" to "user.js" as starting point (it contains
79+
some examples and useful comments how to define your own JavaScript).
7180
ATTENTION: You have to activate the template option "prsnl10_loaduserjs"
7281
(->"Load 'prsnl10/user/user.js'?") in the DokuWiki Config
7382
Manager!
7483

7584
- Web analytics software (Piwik, Google Analytics etc.)
7685
Tools like Piwik and Google Analytics normally provide a small code
7786
snippet ("tag") which you have to include at your website to make
78-
everything work. If you want to use such software with this template, have
79-
a look at "prsnl10/user/tracker.php". This file exists to make it easier
80-
for you. You don't have to deliberate where you have to copy and paste the
81-
code, simply do it there.
87+
everything work. If you want to use such software with this template,
88+
create a "prsnl10/user/tracker.php.dist". You don't have to deliberate
89+
where you have to copy and paste the code, simply do it there. You can
90+
rename the "tracker.php.dist" to "tracker.php" as a good starting point
91+
(it contains some examples and useful comments how to define your own
92+
boxes).
8293

8394
- Own Apple Touch Icon
8495
If you want to replace the default Apple Touch Icon, simply create a
85-
"apple-touch-icon.png" in "prsnl10/user". The template recognizes the
86-
file automatically and will use it instead of the default one. Have a
87-
look at Apple's developer database (cf. "Configuring Web Applications"[4])
88-
if you need more information.
96+
"apple-touch-icon.png" in "prsnl10/user". The template recognizes the file
97+
automatically and will use it instead of the default one. Have a look at
98+
Apple's developer database (cf. "Configuring Web Applications" [4]) if you
99+
need more information.
89100

90101
[1] <http://www.google.com/webfonts/family?family=Droid+Sans>
91102
[2] <http://j.mp/inYDGL>

main.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
}
101101

102102
//load userdefined js?
103-
if (tpl_getConf("prsnl10_loaduserjs")){
103+
if (tpl_getConf("prsnl10_loaduserjs") && file_exists(DOKU_TPL."user/user.js")){
104104
echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/user.js\"></script>\n";
105105
}
106106
?>

user/print.css

Lines changed: 0 additions & 7 deletions
This file was deleted.

user/print.css.dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
Place for user defined CSS rules (print media) - this file can safely be
3+
preserved when updating. See README for details.
4+
5+
Note: All example files are delivered with the ".dist" extensions to make
6+
sure your changes do not get overwritten when updating the template.
7+
Just remove the ".dist" extension to use them.
8+
*/
9+

user/screen.css

Lines changed: 0 additions & 7 deletions
This file was deleted.

user/screen.css.dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
Place for user defined CSS rules (screen media) - this file can safely be
3+
preserved when updating. See README for details.
4+
5+
Note: All example files are delivered with the ".dist" extensions to make
6+
sure your changes do not get overwritten when updating the template.
7+
Just remove the ".dist" extension to use them.
8+
*/
9+

user/tracker.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

user/tracker.php.dist

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/**
4+
* Place for user defined web analytics software codes/tags
5+
*
6+
* Tools like Piwik and Google Analytics normally provide a small HTML code
7+
* snippet ("tag") which you have to include at your website to make everything
8+
* work. This template tries to make this easier for you.
9+
*
10+
* You don't have to deliberate where you have to copy and paste the code
11+
* simply create a "/user/tracker.php" file. The template recognizes and loads
12+
* the provided tracker data automatically. You may want to rename this file
13+
* from "tracker.php.dist" to "tracker.php" to get a good starting point. Just
14+
* copy and paste the needed HTML code/tag AFTER the closing "?>"
15+
*
16+
* Note: All example files are delivered with the ".dist" extensions to make
17+
* sure your changes do not get overwritten when updating the template.
18+
* Just remove the ".dist" extension to use them.
19+
*
20+
*
21+
* LICENSE: This file is open source software (OSS) and may be copied under
22+
* certain conditions. See COPYING file for details or try to contact
23+
* the author(s) of this file in doubt.
24+
*
25+
* @license GPLv2 (http://www.gnu.org/licenses/gpl2.html)
26+
* @author ARSAVA <[email protected]>
27+
* @link http://piwik.org/
28+
* @link http://www.google.com/analytics/
29+
* @link https://www.dokuwiki.org/template:prsnl10
30+
* @link https://www.dokuwiki.org/devel:configuration
31+
*/
32+
33+
34+
//check if we are running within the DokuWiki environment
35+
if (!defined("DOKU_INC")){
36+
die();
37+
}
38+
39+
//place the needed HTML source codes BELOW this line ?>

user/user.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

user/user.js.dist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Place for user defined JavaScript - this file can safely be preserved
3+
when updating. See README for details.
4+
5+
Note: All example files are delivered with the ".dist" extensions to make
6+
sure your changes do not get overwritten when updating the template.
7+
Just remove the ".dist" extension to use them.
8+
9+
To use own JavaScript:
10+
11+
1. Create a /user/user.js file. You may just want to rename this file from
12+
"user.js.dist" to "user.js"
13+
14+
2. Do not forget to activate the template option
15+
"prsnl10_loaduserjs" (->"Load 'prsnl10/user/user.js'?") in the
16+
DokuWiki Config Manager! Otherwise, any changes to this file
17+
won't have any effect!
18+
*/

0 commit comments

Comments
 (0)