Loading...
 
Features / Usability

Features / Usability


Sub trees in PHPLayers

posts: 14 New Zealand

Hi, is it possible to use PHP Layers extended tree functunality with tikiwiki?

I would like to have a menu like this:

Copy to clipboard
Main + Sub + Second Sub


Thanks, and keep up the great work developers biggrin

posts: 4656 Japan

I think the problem is that Tiki itself doesn't provide for more than two levels: section and option. Tiki's menu code would have to have "subsection" level items for PHPLayers to find and use. Don't know what would be involved in making this modification, though.

-- Gary


posts: 14 New Zealand

After a few days of deciphering code I found a solution smile.


in \templates\tiki-admin_options.tpl find

Copy to clipboard
option value="s" {if $type eq 's'}selected="selected"{/if}>{tr}section{/tr} /option> (line 27)

add this line beneath it:

Copy to clipboard
option value="p" {if $type eq 'p'}selected="selected"{/if}>{tr}submenu{/tr} /option>

then in \lib\smarty_tiki\function.phplayers.php find:

Copy to clipboard
if ($cd["type"] == 'o' and $indented) { (line 70) $output.= ".";

add these two lines beneath it:

Copy to clipboard
} elseif ($cd["type"] == 'p') { $output.= "..";

and thats it! You can keep adding more sub menus by using a different value in the two files
(p in this case) and put another . in the output in function.phplayers.php, eg:

Copy to clipboard
} elseif ($cd["type"] == 'r') { $output.= "...";


(i had to take off the < to make it show up here)

posts: 1630 Canada

Hi Xia!

Can you show us a demo?

Extra levels in the menus would be a welcome addition for Tiki 1.9

Thanks!!

M ;-)

posts: 38 United States

> After a few days of deciphering code I found a solution smile.

Great solution. But where do the menus get their style from??? I couldn't find anything in the regular style sheets that would affect these trees. I checked the source of the resulting page and tried modifications to .phplm, .treemenudiv, and .phplmnormal, but couldn't see any changes. I'd like to make the text match the text in the other menus (smaller, same color, etc.)

Any suggestions?

e.d.

posts: 157 United States

You can find those classes in the lib/phplayers folder, i.e. layerstreemenu.css :-)

--Colorado

> Great solution. But where do the menus get their style from??? I couldn't find anything in the regular style sheets that would affect these trees. I checked the source of the resulting page and tried modifications to .phplm, .treemenudiv, and .phplmnormal, but couldn't see any changes. I'd like to make the text match the text in the other menus (smaller, same color, etc.)
>
> Any suggestions?
>
> e.d.


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting