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:

Main
+ Sub
 + Second Sub


Thanks, and keep up the great work developers biggrin

posts: 4614 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

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

add this line beneath it:

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

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

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

add these two lines beneath it:

} 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:

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


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

posts: 1550 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.