Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
default heading color on template (sprintdoc) + plugin (ckgedit)
Avatar
Tin #1
Member for 3 months · 8 posts
Group memberships: Members
Show profile · Link to this post
Subject: default heading color on template (sprintdoc) + plugin (ckgedit)
I am new to Dokuwiki and I am trying to change the default colour of the headers  (h1->h6) so that they have the same colour in both the sprintdoc template and while editing the page content in the ckgedit plugin. I was wondering which is the best way to do this, so that I warranty the durability of future updates specially in the plugin? (as for the template, I'm creating my own based on the sprintdoc template). Here some remarks:

1. Given these posts (https://forum.dokuwiki.org/thread/13642, https://forum.dokuwiki.org/post/56887), one should ideally create a lib/tpl/sprintdoc/conf/userstyle.less file, where the new color for the headers is specified. Would be this enough? My userstyle.less looks like:
h1, h2, h3, h4, h5, h6 {
    font-family: Roboto, Arial, sans-serif;
    font-weight: bold;
    color: yellow;
    padding: 0;
    line-height: 1.2;
    clear: left;
}
which is not working and I would also like to have a variable where I can just set up the colour, instead of hard-coding it.

2. I also noticed that the sprintdoc template has a /css/base_design.less, where the default style for the headers is defined:
h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    padding: 0;
    line-height: 1.2;
    clear: both;
}
So, I added a new variable @init_header_color that contains the new color. The new base_design.less looks like:
h1,h2,h3,h4,h5,h6{
    ....
    color: @init_header_color
    ....
}
The new @init_header_color is set/defined in the sprintdoc/style.ini as:

[replacements]
__header_color = red ; @init_header_color

This already is working fine, but the problem I'm facing is how to use this new variable in conjunction with the ckgedit plugin? Note that the sprintdoc/style.ini file also includes the stylesheets of the the plugins on top of the file:

; _____________  plugin styles _____________
[stylesheets]
...
css/plugins/qc.less                   = all
css/plugins/struct.less               = all
css/plugins/structstatus.less         = all
css/plugins/bureaucracy.less          = all
....

So that I thought, I could create a new file css/plugins/ckgedit.less and add a line to the style.ini:
; _____________  plugin styles _____________
[stylesheets]
...
css/plugins/bureaucracy.less          = all
css/plugins/ckgedit.less              = all
....


In the ckgedit.less file, I could then use the @init_header_color, however the variable is defined only after including the plugin styles, and adding that specific new css/plugins/ckgedit.less at the bottom of the style.ini file, after having defined my variable, showed me a .css problem. Idea would be something like:
; _____________  plugin styles _____________

[stylesheets]
....
css/plugins/bureaucracy.less          = all

[replacements]
....
__header_color = red ; @init_header_color
...
[stylesheets]
css/plugins/ckgedit.less              = all


3. Given these https://forum.dokuwiki.org/thread/10146 and https://forum.dokuwiki.org/thread/13642, the default .css configuration of the ckgedit plugin is in /lib/plugins/ckgedit/ckeditor/contents.css How could I re-use the @ini_header_color variable in that contents.css file?
This post was edited 2 times, last on 2019-04-24, 10:56 by Tin.
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4628 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
If you want to style the editor, then you have to add any additional, unique styling to contents.css.  Since the latter is a compressed file, you can firsr make the changes to contents.css.unc.  You could then simply rename that to contents.css or compress, for which see:
https://www.dokuwiki.org/plugin:ckgedit#compression
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
This post was edited on 2019-04-24, 16:38 by turnermm.
Avatar
Tin #3
Member for 3 months · 8 posts
Group memberships: Members
Show profile · Link to this post
Thank you for the feedback. Now, the question is, what if I re-install the plugin? this means that my changes in contents.css will be lost/overwritten from the original contents.css, doesn't it?
Avatar
turnermm (Moderator) #4
Member since Oct 2009 · 4628 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
Unfortunately, that's true.  You'll have to keep copies.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
Tin #5
Member for 3 months · 8 posts
Group memberships: Members
Show profile · Link to this post
And why does a user-defined  lib/tpl/sprintdoc/conf/userstyle.less file won't work?
Avatar
turnermm (Moderator) #6
Member since Oct 2009 · 4628 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
Easier said than done.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
andi (Administrator) #7
User title: splitbrain
Member since May 2006 · 3422 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #5
Quote by Tin on 2019-04-24, 20:46:
And why does a user-defined  lib/tpl/sprintdoc/conf/userstyle.less file won't work?

Your userstyles do not belong into the template folder. They go directly into the main conf directory. Put it in conf/userstyle.less and it will be applied and can be used to overwrite all styles, plugins and template alike.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
turnermm (Moderator) #8
Member since Oct 2009 · 4628 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
He doesn't want to change dokuwiki's output but the look and feel of the ckeditor's editing window which is independent of the template . I just took him at his word that his template has a userstyles.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
andi (Administrator) #9
User title: splitbrain
Member since May 2006 · 3422 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yeah OP should also be able to restyle ckgedit through userstyles. I believe I did so myself in the past.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
turnermm (Moderator) #10
Member since Oct 2009 · 4628 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
We're are talking about apples and oranges here.  The output to the browser from dokuwiki, of course.  That's what ckgedit does. But he wants to  make changes to the html inside the ckeditor's editing window.  He can do that, but by editing ckeditor/contents.css.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
The author has attached one file to this post:
2019-05-02 14_57_17-✎ playground_links [devel].png 151.6 kBytes
You have no permission to open this file.
Avatar
turnermm (Moderator) #11
Member since Oct 2009 · 4628 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
I've been thinking about this and may have hit on a way to accommodate it.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
turnermm (Moderator) #12
Member since Oct 2009 · 4628 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
In reply to post #5
I've added a new feature which enables you to create and install a template-based style sheet for the ckeditor's editing window.  See  https://www.dokuwiki.org/plugin:ckgedit:configuration#styl…
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-05-24, 09:37:34 (UTC +02:00)