Code Monkey home page Code Monkey logo

Comments (6)

Klap-in avatar Klap-in commented on July 17, 2024 1

If I add the extra pagemenu-entries from plugins with the code from example at:
arsava/dokuwiki-template-vector#64

This snippet add the pagemenu-entries from plugins to list with links in the sidebar.

Furhermore, I made some changes to the last version of bookcreator, which support these links now as well.

from dokuwiki-plugin-bookcreator.

sabrinasonno avatar sabrinasonno commented on July 17, 2024

Hi
I have the same problem. I don't see the icon in all pages
The version is DokuWiki version: Release 2018-04-22b "Greebo"

Can anybody help us?
Thank you

from dokuwiki-plugin-bookcreator.

Klap-in avatar Klap-in commented on July 17, 2024

Do you have any error message? In web server log, or in console of your browser (reachable via 'Inspect' in right-mouse-button menu)

Does it make a difference if you use a different browser?

from dokuwiki-plugin-bookcreator.

 avatar commented on July 17, 2024

I don't see anything unusual in the browser console or the server logs. It does seem to be an issue where style="display:none" is being added to the list item. Maybe something to do with this?

image

from dokuwiki-plugin-bookcreator.

eduardomozart avatar eduardomozart commented on July 17, 2024

I was receiving this error into "Vector" template.
It was happening because the jQuery associates the Bookcreator link/button with the "plugin_bookcreator__addtobook" class. In my case, it was happening because jQuery (throught script.js file available at Bookcreator plugin root directory) couldn't find any HTML element with "plugin_bookcreator__addtobook" class (add/remove pages to the book), so instead of adding/remove pages to the book on-the-fly (without reloading the page, as it happens with any other template), the web browser was redirecting to the page https://wiki.example.com/doku.php?id=[pageid]&do=plugin_bookcreator__addtobook . Apparently the javascript doesn't trigger any error to the console when the class element "plugin_bookcreator__addtobook" doesn't exists into the page.

It was working with any other template because the Bookcreator link/button is created hooking MENU_ITEMS_ASSEMBLY DokuWiki event (this event add the Bookcreator link/icon into the page and appends the "plugin_bookcreator__addtobook" class to the Bookcreator "li" [list item] element), but the Vector template doesn't handle this event, so I was using the code below to add the Bookcreator manually at my template at /lib/tpl/vector/user/tabs.php:

//custom plugin tab
$items = (new \dokuwiki\Menu\PageMenu())->getItems();
foreach($items as $item) {
    $query = parse_url($item->getLink(), PHP_URL_QUERY);
    parse_str($query, $params);
 
    if(!(empty($params['do'])) and !preg_match("/\b(&do=edit|&do=revisions|&do=backlink|&do=export_odt|&do=export_pdf|dokuwiki__top)\b/", $item->getLink())) {
        $_vector_tabs_right["tab-" . $params['do']]["text"]     = $item->getLabel();
        $_vector_tabs_right["tab-" . $params['do']]["href"]     = $item->getLink();
        $_vector_tabs_right["tab-" . $params['do']]["nofollow"] = true;
    }
}

This code parses the PageItems and add the third-party plugins to the Vector template tab. The Bookcreator link was showing as expected, but wasn't working with the "Failed to handle action: plugin_bookcreator__addtobook" error. The solution was adding the following line to the code:

        $_vector_tabs_right["tab-" . $params['do']]["class"] = $params['do'];

This last line added the class "plugin_bookcreator__addtobook" to the link and it started working normally. I did tried to use a user custom JS to append the "plugin_bookcreator__addtobook" class after the page loading, but it fails, probably because the Bookcreator "script.js" file was trying to hook the element with "plugin_bookcreator__addtobook" class before the parsing my user custom JavaScript, so it fails. So yeah, if you're receiving this error with your template, you'll need to edit your template file directly to add a reference to Bookcreator "plugin_bookcreator__addtobook" class into it.

from dokuwiki-plugin-bookcreator.

Klap-in avatar Klap-in commented on July 17, 2024

Ah, I haven’t tested templates which doesn’t use the newest page tool menus. This is worth a look.

from dokuwiki-plugin-bookcreator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.