Subsubpages

Post Reply
matto
Jr. Bludit
Posts: 9
Joined: Fri Feb 19, 2016 6:50 pm

Hi!

Is it possible to have subsubpages?

I haven't looked through the code, is it possible by design to set a page as child of another parents child?

BTW, if someone is interested, i am working on a theme with mdl
https://github.com/muellmatto/bludit-mdl-seht and created a really simple (not good ;) ) searchfunction
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

matto wrote: I haven't looked through the code, is it possible by design to set a page as child of another parents child?
At the moment this is not possible.

You can try to do it manually (a subpage is a subdirectory of a page).
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
matto
Jr. Bludit
Posts: 9
Joined: Fri Feb 19, 2016 6:50 pm

Hi!

simply adding a subfolder with an index.txt does not work, i guess i have to manually edit the database?

I don't know where to start getting this to work.
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

matto wrote: simply adding a subfolder with an index.txt does not work, i guess i have to manually edit the database?
No, this does not yet work. It's just an idea how to start. You have also either to modify the navigation script or to make a hard coded navigation.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

Hi,
could you give me some example of the usage of sub-subpages?

For the moment Bludit support Partent->Child pages.

Regards
Thermalzombie
Jr. Bludit
Posts: 7
Joined: Fri Jul 22, 2016 1:56 am

Not sure if correct this is what I think of and would also like this feature.

Current:
Partent -> Child pages

With sub pages:
Partent -> Subpages -> Child pages

PC -> Hardware -> product name
PC -> Software-> Product name
User avatar
VanHalen
Jr. Bludit
Posts: 9
Joined: Wed Jun 29, 2016 2:48 pm
Location: The Netherlands

I display 'sub sub pages' simply by loading another parent page inside a subpage. All my pages are hidden by default in the main navigation unless a tag is selected in the admin, like 'show in menu'.

To hide all menu items by default i created a custom navigation menu and then added the following line to the parent and child page foreach loops after the if($parent->published()){ look up the Pages plugin for more info about it.

Code: Select all

<?php if($parent->tags() == 'show in menu') { ?>display menu link<?php } ?>
And in page.php (or your custom template pages) use something similar to this:

Code: Select all

<?php

//check if the unlisted parent page exist
if(isset($pagesParents['your-unlisited-parent-pagename'])) {

//look up the subpages of that parent page and display.
$children = $pagesParents['your-unlisited-parent-pagename'];

	foreach($children as $child) {
		
		if( $child->published()) {
		
			echo $child->title();
			
			if($child->coverImage()) {
				$child->coverImage();
			}
				
		}
	}
}

?>
There are probably 100 better ways, but this works for me.
Post Reply