nomadjimbob / mikio

Customizable, Bootstrap 4 inspired template for Dokuwiki
GNU General Public License v2.0
22 stars 6 forks source link

Logo in header links to a different page #27

Closed karamellpelle closed 3 years ago

karamellpelle commented 3 years ago

If I press the icon or text in the header, I will jump to the homepage. Is there an easy way to change it to another page (or is my case so specific I should just edit mikio.php myself)?

The reason is that I use the plugin showpageafterlogin which defines a landing page for users. As now, when a logged in user clicks the icon/text in the header, he will jump to the (public) front page. Instead I want him to jump to the landing page. PS: If I need to write the php-code myself, is there a way to check if the current user is logged in?

Thank you for this beautiful theme :heart:

nomadjimbob commented 3 years ago

Hi and thanks for the feedback.

The navbar url will now honour the setting in showpageafterlogin if the plugin is installed and enabled and the user is logged in.

For your info, you can find the code in the commit d3d7d2b7d45dca157187b8881d435120d0d8f977

karamellpelle commented 3 years ago

Thank you, this was very fast delivered! It worked well. Now I've been thinking if there should be a configuration that defines the page which the logo directs to - regardless of the plugin showpageafterlogin? A user of the plugin showpageafterlogin (or others) may still want another page as the logo link. For example, showpageafterlogin has a configuration login_display_count which means that the landing page may be temporary.

Another thing I could mention was a problem I got when I now did the Mikio-upgrade. My styling (style.less in subtheme folder) did not work. Neither did the mikio.less work - only mikio.css. It turned out to be caused by LESS compilation failed in css.php: It couldn't find the @ini_site_width variable since I was using my old conf/tpl/mikio/style.ini. This took long time to find out. Maybe the exception in caught in css.php should be printed out in some way?

nomadjimbob commented 3 years ago

I'll add the logo url option in the next release: #29

The less parse failure is a bit tricky to catch as it is executed by the browser separately to the theme itself and most browsers will ignore any output from the parser that is not CSS.

I guess the css parser could include default values for ini variables if they are missing for any reason which would catch this problem. I could maybe add a 'Test for LESS Errors' button in the admin which would run the parser inside the theme in order to catch any exceptions and inform the user. I've moved this into a seperate issue #30