Display child page details on parent

Post Reply
User avatar
bayerberg
Master Bludit
Posts: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 9 times
Been thanked: 10 times
Contact:

Hi. I need to display title and description of child pages on parent page.
How best to do that? How to show max 6 children and paginate the rest?

Thanks! :)
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
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:

Can you please give me an example of it. I do not really understand how it should work.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
bayerberg
Master Bludit
Posts: 141
Joined: Wed Jun 07, 2017 1:05 pm
Location: London, UK
Has thanked: 9 times
Been thanked: 10 times
Contact:

hope this helps

i need to check if the page has children and when it has I need to display excerpts
Image

I might have a lot of subpages (childpages) so if there would be pagination that would be stellar ;)

Thanks!
bludit plugins and themes - makeitblu | I do things, check them out on behance and dribbble.
User avatar
Torsten_Kelsch
Legend Bludit
Posts: 263
Joined: Thu Aug 27, 2015 10:24 pm
Location: Germany
Has thanked: 4 times
Been thanked: 2 times
Contact:

Something like the plugin Menü aller Seiten (I don’t know what the English name is, maybe menu of all pages or so) could help you. But you will have to change the code to your needs, because only the page names are listed, not any excerpts of the content.
On Error GoTo Bed
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:

As Torsten mentioned you can adapt the code of the plugin Page list. Especially the loop to show snippets of the child pages.

Instead of $childPage you can use $child:

$child->title()
$child->coverImage()
$child->description()
$child->permalink()

etc.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply