Klap-in / dokuwiki-plugin-bookcreator

Allow to select some pages and create a book (PDF, ODT or text)

Home Page:https://www.dokuwiki.org/plugin:bookcreator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrap plugin column layout is broken once bookcreator enabled

mjcmatrix opened this issue · comments

commented

On a wikipage that uses the 'wrap' plugin to format content into two columns (e.g. <WRAP column half>content</WRAP>), once bookcreator has been installed, columns are the correct width but stack vertically instead of appearing side-by-side. (This does not happen in 'preview' mode, where the columns display correctly.)

There appears to be a conflict between the two plugins. I have identified the cause.

Wrap uses div containers for each column and index-based 'Nth of type' div selectors for CSS styling. There is an extra div inserted by bookcreator (for it's toolbar), which breaks wrap's styling.

If "Show toolbar" in the bookcreator configuration settings is set to Never, the div is still present in the HTML but has style="display: none", so still messes up columns. (If the toolbar div was omitted from the markup, rather than hidden, a workaround to this plugin conflict would be to set Never display toolbar.)

Disabling the bookcreator plugin fixes wrap.

Changing the element type from div to nav in the browser, also fixes the issue, i.e.

<nav id="bookcreator__memory" style="display: none;" data-isselected="false"></nav>

commented

The workaround I am using is to patch lib/plugins/bookcreator/action.php
Here:

        // show or not the toolbar ?
        if(($this->getConf('toolbar') == "never") || (($this->getConf('toolbar') == "noempty")) && ($this->num == 0)) {
            return;
        }

I reorganise the parenthesis on this if statement from:

        if((($this->getConf('toolbar') == "never") || ($this->getConf('toolbar') == "noempty")) && ($this->num == 0)) {

to:

        if(($this->getConf('toolbar') == "never") || (($this->getConf('toolbar') == "noempty")) && ($this->num == 0)) {

I have tested this, with the auto and never setting of the bookcreator. I cannot reproduce this anymore. Also a quick look at the css styles of the wrap plugin does not show some suspicious cases.

Please reopen and add some example code if you can still replicate this issue.