paw.MoreLevels
-
- Master Bludit
- Posts: 106
- Joined: Tue Dec 25, 2018 8:07 pm
- Been thanked: 3 times
Hellow,
I guess, there is currently no frontend theme, which supports a multi-level navigation using paw.MoreLevels. But I'm using this plugin on my own, on a small internal project, and wrote the following snippet for a multi-level Table of Content Widget.
Note: This solution works ONLY if you're ordering the content after the position (and depth) on your own (or if you order the respective $data array manually, of course).
The result looks like this:
So, in fact, you need to create an own respective loop, fetch each page on your own and use the respective methods of the "Page" class to create your link / URL working.
Sincerely,
Sam.
I guess, there is currently no frontend theme, which supports a multi-level navigation using paw.MoreLevels. But I'm using this plugin on my own, on a small internal project, and wrote the following snippet for a multi-level Table of Content Widget.
Note: This solution works ONLY if you're ordering the content after the position (and depth) on your own (or if you order the respective $data array manually, of course).
Code: Select all
$data = $pages->getPublishedDB(); // Get published Page Keys
$count = 0;
do{
$item = new Page(current($data)); // Get current Page Object
$next = next($data); // Get next Page Key
prev($data); // Reset $data Array
// Just a Basic Example
echo str_repeat("- ", $count) . $item->title() . "<br />";
if(substr_count($next, "/") > $count){
$count++;
} else if(substr_count($next, "/") < $count){
$count -= ($count - substr_count($next, "/"));
}
} while(next($data));
So, in fact, you need to create an own respective loop, fetch each page on your own and use the respective methods of the "Page" class to create your link / URL working.
Sincerely,
Sam.