Page 1 of 1

Toc/xTOC with tooltips

Posted: Thu Jan 03, 2013 8:44 am
by Tata
Is there a way to have "hover tooltips" for menu items if there is e.g. alternative heading used?
It was explained on some of websites long ago. But it was before the jQuery was introduced with CMSimple. Now I can find the website anymore.

E.g.:

<h1>HEADING 1</h1> has an alternative heading HEADING OF THE FIRST PAGE. And this should be shown at hover in TOC.

Re: Toc/xTOC with tooltips

Posted: Thu Jan 03, 2013 1:56 pm
by cmb
Hi Tata,

this can be done by modifying the function li() in cmsimple/cms.php. Around line 1058 you'll find:

Code: Select all

        if ($tf)
            $t .= '</a>'; 
Replace these 2 lines with:

Code: Select all

        if ($tf) {
            global $pd_router;

            $pd = $pd_router->find_page($ta[$i]);
            if ($pd['show_heading'] == '1') {
                $t .= '<span>' . $pd['heading'] . '</span>';
            }
            $t .= '</a>';
        } 
The rest is CSS. A primitive solution:

Code: Select all

ul.menulevel1 span {display:none}
ul.menulevel1 a:hover span {display:inline}
If you want to show the hover tooltip also for the current page, you have to use xtoc and modify it accordingly. And well, this output is generated also for the sitemap and the submenu, so their styling has to be modified to.

BTW: just yesterday I've stumpled across HIT again. Perhaps something, that might be offered as a plugin in an improved version? Any volunteers?

Christoph

Re: Toc/xTOC with tooltips

Posted: Sun Sep 26, 2021 4:17 pm
by Tata
Wie wäre es jetzt mit 1.7.4+?