Difference between revisions of "Create new skin"
Josef.Noll (Talk | contribs) m |
Josef.Noll (Talk | contribs) (→Customisation of the wiki) |
||
(21 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | = Create new | + | {{TOCright}} |
+ | How to create a new skin, and "[[BasicInternet:How_to_edit]]" a web page.... | ||
+ | = [[Title::Create new skin for a project]]= | ||
following examples in owncloud file CreateNewSkin_setup.docx | following examples in owncloud file CreateNewSkin_setup.docx | ||
* Copy /etc/skins/bif (including BIF*.php) into a new directory, e.g. SAT | * Copy /etc/skins/bif (including BIF*.php) into a new directory, e.g. SAT | ||
Line 9: | Line 11: | ||
= Update custom skin (SAT) = | = Update custom skin (SAT) = | ||
− | edits in | + | edits in SAT.php |
* include the background-image sat_logo.png - 190 x 105 px | * include the background-image sat_logo.png - 190 x 105 px | ||
− | * and link http://cwi.unik.no/SAT: | + | * and link http://cwi.unik.no/SAT:Home (!note: no 'wiki' in this link) |
edit sat_template.css | edit sat_template.css | ||
− | * | + | * dark blue #060080, Telenor SAT #457ABE, GravidPluss #993365, light Gravid #CD99B2 |
− | * ''note:'' | + | ** Gradients are done using: |
+ | ** background: #0C4B88; /* Fallback for IE */ | ||
+ | ** background: linear-gradient(#001F53, #0C4B88); | ||
+ | * line106 sat-header = background: #457ABE; | ||
+ | * line 165 p-logo = background…. | ||
+ | * line 610 sat-footer = background …. | ||
+ | * ''note'': header colour in MediaWiki:Hf-nsheader-SAT | ||
+ | * line 99 = h1, h2, h3 { color: #060080; } | ||
+ | |||
+ | Colours used for DigI | ||
+ | * 250, 245, 189 yellow and 48,77,11 for green | ||
+ | |||
+ | ''note:'' main.css = p-logo, width: 11em; | ||
== Customisation of the wiki == | == Customisation of the wiki == | ||
− | Navbar is defined through MediaWiki:Hf-nsheader-SAT | + | Navbar is defined through [[MediaWiki:Hf-nsheader-SAT]], [[MediaWiki:Hf-nsheader-GravidPluss]], [[MediaWiki:Hf-nsheader-BasicInternet]], [[MediaWiki:Hf-nsheader-DigI]] and for main [[MediaWiki:Hf-nsheader-]] |
− | * [[Template:Main_Navbar]], [[Template: | + | * [[Template:Main_Navbar]], [[Template:BIF_Navbar]], [[Template:GravidPluss_Navbar]], [[Template:GravidAdmin_Navbar]], [[Template:DigI_Navbar]], [[Template:DigAdmin_Navbar]] |
+ | * Footer like [[MediaWiki:Hf-nsfooter-DigI]] using e.g. gravid skin, need to change CSS defined in skins/gravid/gravid_template.css for updated colours in footer | ||
+ | ** Footer for main namespace [[MediaWiki:Hf-nsfooter-]] | ||
+ | |||
<pre> grep -rnw '.' -e "navbar" </pre> to identify text in directory | <pre> grep -rnw '.' -e "navbar" </pre> to identify text in directory | ||
* edit header | * edit header | ||
Line 28: | Line 45: | ||
</pre> | </pre> | ||
+ | on MediaWiki:Common.css | ||
+ | * add #bif-p-search, #sat-p-search | ||
+ | * .catlinks { display: none; } # for removing overlapp of category links | ||
== edit namespaces.php == | == edit namespaces.php == | ||
Line 87: | Line 107: | ||
== Citi Admin settings == | == Citi Admin settings == | ||
− | < | + | <pre># create user group 'CitiAdminUsers' |
$wgGroupPermissions['CitiAdminUsers']['read'] = true; | $wgGroupPermissions['CitiAdminUsers']['read'] = true; | ||
#restrict "read" permission to logged in users | #restrict "read" permission to logged in users | ||
Line 121: | Line 141: | ||
$wgNonincludableNamespaces[] = 179; | $wgNonincludableNamespaces[] = 179; | ||
</pre> | </pre> | ||
+ | |||
+ | |||
+ | ---- | ||
+ | = Footer configuration = | ||
+ | uses: Extension:Header_Footer | ||
+ | |||
+ | === Per-Namespace Header and Footer === | ||
+ | Edit the pages: | ||
+ | * <code>MediaWiki:Hf-nsheader-''namespace name'' </code> | ||
+ | * <code>MediaWiki:Hf-nsfooter-''namespace name'' </code> | ||
+ | For the 'main' namespace, just use ''blank'' i.e. no string, but with the hyphen: | ||
+ | * <code>MediaWiki:Hf-nsheader- </code> | ||
+ | * <code>MediaWiki:Hf-nsfooter- </code> | ||
+ | |||
+ | === Per-Page Header and Footer === | ||
+ | Edit the pages: | ||
+ | * <code>MediaWiki:Hf-header-''page name'' </code> | ||
+ | * <code>MediaWiki:Hf-footer-''page name'' </code> | ||
+ | === Disable commands === | ||
+ | On ''edit'' protected pages, one can add | ||
+ | * <code> __ NOHEADER __ </code> to suppress the page level header | ||
+ | * <code>__ NOFOOTER __</code> to suppress the page level footer | ||
+ | * <code>__ NONSHEADER __</code> to suppress the namespace level header | ||
+ | * <code>__ NONSFOOTER __</code> to suppress the namespace level footer | ||
+ | |||
+ | === CSS === | ||
+ | * Page Level Header: <nowiki><div class="hf-header"></nowiki> | ||
+ | * Namespace Level Header: <nowiki><div class="hf-nsheader"></nowiki> | ||
+ | * Page Level Footer: <nowiki><div class="hf-footer"></nowiki> | ||
+ | * Namespace Level Footer: <nowiki><div class="hf-nsfooter"></nowiki> | ||
+ | * extra space before footer: <nowiki><div class="cwi-custom-footer"></nowiki> | ||
+ | |||
+ | === Extra space before footer === | ||
+ | ''Error:'' the custom footer was overlapping with the Namespace Level Footer hf-nsfooter | ||
+ | * add <nowiki> <div id="cwi-custom-footer"></div> </nowiki> to CWI.php | ||
+ | <nowiki> | ||
+ | <code> <!-- ///// cwi custom footer space ///// --> | ||
+ | <div id="cwi-custom-footer"></div> | ||
+ | <!-- ///// cwi-footer ///// --> | ||
+ | <div id="cwi-footer"> | ||
+ | <?php $this->contentActionBox(); ?> | ||
+ | <div class="cwi-footer-spacer"></div> | ||
+ | <?php $this->toolBox(); ?> | ||
+ | <?php $this->footerBox(); ?> | ||
+ | </div> | ||
+ | </code> | ||
+ | </nowiki> | ||
+ | * add example for <nowiki><div class="cwi-custom-footer"></nowiki> in cwi-template.css | ||
+ | |||
+ | Alternatively, add the following lines to the Web pages, e.g. [[Template:GravidPluss_About]] | ||
+ | <nowiki><code> | ||
+ | {{#css: | ||
+ | #bif-header {display:none !important;} | ||
+ | #bif-p-navigation {display:none !important;} | ||
+ | .bif-p-navigation-spacer {display:none !important;} | ||
+ | #bif-footer {display:none !important;} | ||
+ | #cwi-header {display:none !important;} | ||
+ | #cwi-p-navigation {display:none !important;} | ||
+ | .cwi-p-navigation-spacer {display:none !important;} | ||
+ | #cwi-footer {display:none !important;} | ||
+ | }} | ||
+ | </code></nowiki> | ||
+ | |||
+ | == Specific cwi settings == | ||
+ | Namespace BasicInternet | ||
+ | * [[MediaWiki:Hf-nsfooter-BasicInternet]] | ||
+ | Namespace Main | ||
+ | * [[MediaWiki:Hf-nsfooter-]] | ||
+ | |||
+ | Colour codes | ||
+ | * CWI blue #174F86 | ||
+ | * BasicInternet white #DC143C | ||
+ | |||
+ | Overall width: 999px, framed 979px | ||
+ | * changed font to small in cwi_template.css | ||
+ | |||
+ | <pre> | ||
+ | {| id="cwi_footer" style="width:100%" <!---- defined in skins/bif/main.css ---> | ||
+ | |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Home </span> | ||
+ | |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Visjon2030 </span> | ||
+ | |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Home </span> | ||
+ | |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Lists </span> | ||
+ | |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Forms </span> | ||
+ | |} | ||
+ | </pre> | ||
+ | |||
+ | = Namespaces = | ||
+ | Our Namespaces used on praia.unik.no - | ||
+ | * Main - colour #0c 4b 88 (for colour behind menu) | ||
+ | * 152 Yeboo | ||
+ | * 154 SMT | ||
+ | * 156 Movation | ||
+ | * 158 Nextelco | ||
+ | * 160 FWA (free web access) | ||
+ | * 162 SecEDU | ||
+ | * 164 GravidPluss | ||
+ | * 166 BasicInternet | ||
+ | * 168 UNIKUM | ||
+ | * 170 BasicAdmin - group: BasicAdmin (using Lockdown) | ||
+ | * 172 GravidAdmin - group:GravidAdmin | ||
+ | * 174 CitiAdmin - group:CitiAdminUsers | ||
+ | * 176 CSM (for Citi-Sense-MOB) - CSMUsers | ||
+ | * 178 SAT - for ESA Ka Satellite propagation - public for all | ||
+ | ** Colour: 00 1B 71 | ||
+ | * see all in praia ... /var/www/mediawiki/namespaces.pnp | ||
+ | |||
+ | Elements: | ||
+ | * colour behind Menu: .cwi-portlet (background) | ||
+ | |||
+ | = Specific pages = | ||
+ | * MediaWiki:Createaccount-text for the login message | ||
+ | * $wgFavicon = '/GP_Icon/favicon.ico'; #Favicon in ITS.php... | ||
+ | |||
[[Category:IT-help]] | [[Category:IT-help]] |
Latest revision as of 14:30, 16 March 2017
Wiki for ITS | ||||||
---|---|---|---|---|---|---|
|
![]() |
How to create a new skin, and "BasicInternet:How_to_edit" a web page....
Create new skin for a project
following examples in owncloud file CreateNewSkin_setup.docx
- Copy /etc/skins/bif (including BIF*.php) into a new directory, e.g. SAT
- change all BIF into SAT (or project shortcut)
- create namespace (see further down)
- create home page for that namespace, explanation of elements in BasicInternet:How_to_edit
- wrong: edit /etc/nginx/sites-enabled/default and add subdirectory, e.g. sat.unik.no (ask Arild to do)
- create logo sat_logo.png and put it into $IP/skins/common/images
Update custom skin (SAT)
edits in SAT.php
- include the background-image sat_logo.png - 190 x 105 px
- and link http://cwi.unik.no/SAT:Home (!note: no 'wiki' in this link)
edit sat_template.css
- dark blue #060080, Telenor SAT #457ABE, GravidPluss #993365, light Gravid #CD99B2
- Gradients are done using:
- background: #0C4B88; /* Fallback for IE */
- background: linear-gradient(#001F53, #0C4B88);
- line106 sat-header = background: #457ABE;
- line 165 p-logo = background….
- line 610 sat-footer = background ….
- note: header colour in MediaWiki:Hf-nsheader-SAT
- line 99 = h1, h2, h3 { color: #060080; }
Colours used for DigI
- 250, 245, 189 yellow and 48,77,11 for green
note: main.css = p-logo, width: 11em;
Customisation of the wiki
Navbar is defined through MediaWiki:Hf-nsheader-SAT, MediaWiki:Hf-nsheader-GravidPluss, MediaWiki:Hf-nsheader-BasicInternet, MediaWiki:Hf-nsheader-DigI and for main MediaWiki:Hf-nsheader-
- Template:Main_Navbar, Template:BIF_Navbar, Template:GravidPluss_Navbar, Template:GravidAdmin_Navbar, Template:DigI_Navbar, Template:DigAdmin_Navbar
- Footer like MediaWiki:Hf-nsfooter-DigI using e.g. gravid skin, need to change CSS defined in skins/gravid/gravid_template.css for updated colours in footer
- Footer for main namespace MediaWiki:Hf-nsfooter-
grep -rnw '.' -e "navbar"to identify text in directory
- edit header
MediaWiki:Hf-nsheader-BasicInternet which includes - {{PAGENAME}}, - {{BasicInternet Navbar}} - MediaWiki:Hf-nsfooter-BasicInternet
on MediaWiki:Common.css
- add #bif-p-search, #sat-p-search
- .catlinks { display: none; } # for removing overlapp of category links
edit namespaces.php
# Skins $wgSkinPerNamespace[NS_BIF] = "bif"; $wgSkinPerNamespace[NS_BIF_TALK] = "bif";
Access control, Extension:Lockdown
- in extensions.php
require_once "$IP/extensions/Lockdown/Lockdown.php";
Examples
# Namespace SAT ESA-Ka-band 178,179 define("NS_SAT", 178); define("NS_SAT_TALK", 179); # include custom NS to configuration array $wgExtraNamespaces[NS_SAT] = 'SAT'; $wgExtraNamespaces[NS_SAT_TALK] = 'SAT_talk'; # Restrict SAT namespace edit $wgNamespaceProtection[NS_SAT] = array('SAT-edit'); $wgNamespaceProtection[NS_SAT_TALK] = array('SAT-talk-edit'); $wgGroupPermissions['SATUsers']['SAT-edit'] = true; $wgGroupPermissions['SATUsers']['SAT-talk-edit'] = true; # enable namespaces search $wgNamespacesToBeSearchedDefault[NS_SAT] = true; $wgNamespacesToBeSearchedDefault[NS_SAT_TALK] = false; # enale Namespaces Subpages $wgNamespacesWithSubpages[NS_SAT] = true; $wgNamespacesWithSubpages[NS_SAT_TALK] = true; # add to NamespacesWithSemanticLinks $smwgNamespacesWithSemanticLinks [NS_SAT] = true; # create user group 'SATUsers' $wgGroupPermissions['SATUsers']['write'] = true; #restrict "read" permission to logged in users $wgNamespacePermissionLockdown[178]['read'] = array('*'); $wgNamespacePermissionLockdown[178]['edit'] = array('SATUsers'); $wgNamespacePermissionLockdown[178]['create'] = array('SATUsers'); $wgNamespacePermissionLockdown[179]['read'] = array('SATUsers'); #prevent inclusion of pages from that namespace # $wgNonincludableNamespaces[] = 178; # public namespace $wgNonincludableNamespaces[] = 179;
Basic Admin settings
# create user group 'BasicAdminUsers' $wgGroupPermissions['BasicAdminUsers']['read'] = true; #restrict "read" permission to logged in users $wgNamespacePermissionLockdown[170]['read'] = array('BasicAdminUsers'); # only BasicAdminUsers can read $wgNamespacePermissionLockdown[170]['edit'] = array('BasicAdminUsers'); $wgNamespacePermissionLockdown[170]['create'] = array('BasicAdminUsers'); $wgNamespacePermissionLockdown[171]['read'] = array('BasicAdminUsers'); #prevent inclusion of pages from that namespace $wgNonincludableNamespaces[] = 170; $wgNonincludableNamespaces[] = 171;
Citi Admin settings
# create user group 'CitiAdminUsers' $wgGroupPermissions['CitiAdminUsers']['read'] = true; #restrict "read" permission to logged in users $wgNamespacePermissionLockdown[174]['read'] = array('CitiAdminUsers'); # only CitiAdminUsers can read $wgNamespacePermissionLockdown[174]['edit'] = array('CitiAdminUsers'); $wgNamespacePermissionLockdown[174]['createpage'] = array('CitiAdminUsers'); $wgNamespacePermissionLockdown[174]['upload'] = array('CitiAdminUsers'); $wgNamespacePermissionLockdown[175]['read'] = array('CitiAdminUsers'); #prevent inclusion of pages from that namespace $wgNonincludableNamespaces[] = 174; $wgNonincludableNamespaces[] = 175;
define custom namespaces
# in namespaces.php #creating a group - as soon as the group permission is addressed, the group is created $wgGroupPermissions['CitiAdmin']['read'] = true; # namespace example $wgExtraNamespaces[100] = 'Private'; $wgExtraNamespaces[101] = 'Private_talk'; # create user group $wgGroupPermissions['SATUsers']['write'] = true; #restrict "read" permission to logged in users $wgNamespacePermissionLockdown[178]['read'] = array('*'); $wgNamespacePermissionLockdown[178]['edit'] = array('SATUsers'); $wgNamespacePermissionLockdown[178]['create'] = array('SATUsers'); $wgNamespacePermissionLockdown[179]['read'] = array('SATUsers'); #prevent inclusion of pages from that namespace # $wgNonincludableNamespaces[] = 178; # public namespace $wgNonincludableNamespaces[] = 179;
uses: Extension:Header_Footer
Edit the pages:
-
MediaWiki:Hf-nsheader-namespace name
-
MediaWiki:Hf-nsfooter-namespace name
For the 'main' namespace, just use blank i.e. no string, but with the hyphen:
-
MediaWiki:Hf-nsheader-
-
MediaWiki:Hf-nsfooter-
Edit the pages:
-
MediaWiki:Hf-header-page name
-
MediaWiki:Hf-footer-page name
Disable commands
On edit protected pages, one can add
-
__ NOHEADER __
to suppress the page level header -
__ NOFOOTER __
to suppress the page level footer -
__ NONSHEADER __
to suppress the namespace level header -
__ NONSFOOTER __
to suppress the namespace level footer
CSS
- Page Level Header: <div class="hf-header">
- Namespace Level Header: <div class="hf-nsheader">
- Page Level Footer: <div class="hf-footer">
- Namespace Level Footer: <div class="hf-nsfooter">
- extra space before footer: <div class="cwi-custom-footer">
Error: the custom footer was overlapping with the Namespace Level Footer hf-nsfooter
- add <div id="cwi-custom-footer"></div> to CWI.php
<code> <!-- ///// cwi custom footer space ///// --> <div id="cwi-custom-footer"></div> <!-- ///// cwi-footer ///// --> <div id="cwi-footer"> <?php $this->contentActionBox(); ?> <div class="cwi-footer-spacer"></div> <?php $this->toolBox(); ?> <?php $this->footerBox(); ?> </div> </code>
- add example for <div class="cwi-custom-footer"> in cwi-template.css
Alternatively, add the following lines to the Web pages, e.g. Template:GravidPluss_About <code> {{#css: #bif-header {display:none !important;} #bif-p-navigation {display:none !important;} .bif-p-navigation-spacer {display:none !important;} #bif-footer {display:none !important;} #cwi-header {display:none !important;} #cwi-p-navigation {display:none !important;} .cwi-p-navigation-spacer {display:none !important;} #cwi-footer {display:none !important;} }} </code>
Specific cwi settings
Namespace BasicInternet
Namespace Main
Colour codes
- CWI blue #174F86
- BasicInternet white #DC143C
Overall width: 999px, framed 979px
- changed font to small in cwi_template.css
{| id="cwi_footer" style="width:100%" <!---- defined in skins/bif/main.css ---> |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Home </span> |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Visjon2030 </span> |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Home </span> |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Lists </span> |<span style="font-weight:bold; font-size: 120%; color:#DC143C"> Forms </span> |}
Namespaces
Our Namespaces used on praia.unik.no -
- Main - colour #0c 4b 88 (for colour behind menu)
- 152 Yeboo
- 154 SMT
- 156 Movation
- 158 Nextelco
- 160 FWA (free web access)
- 162 SecEDU
- 164 GravidPluss
- 166 BasicInternet
- 168 UNIKUM
- 170 BasicAdmin - group: BasicAdmin (using Lockdown)
- 172 GravidAdmin - group:GravidAdmin
- 174 CitiAdmin - group:CitiAdminUsers
- 176 CSM (for Citi-Sense-MOB) - CSMUsers
- 178 SAT - for ESA Ka Satellite propagation - public for all
- Colour: 00 1B 71
- see all in praia ... /var/www/mediawiki/namespaces.pnp
Elements:
- colour behind Menu: .cwi-portlet (background)
Specific pages
- MediaWiki:Createaccount-text for the login message
- $wgFavicon = '/GP_Icon/favicon.ico'; #Favicon in ITS.php...