Display regular pages on a static page that is not the homepage
Posted: Mon Apr 22, 2024 9:54 pm
Hello!
I have the following page structure:
• Info (Static, defined as the frontpage in the backend)
• Projects (Static)
• Contact (Static)
• Project 1
• Project 2
• ...
In my index.php, I have:
Now, in the projects template, I want to display the regular pages (the projects). However, if I use the foreach loop from the documentation, it doesn't work because it only displays the child pages of the displayed page:
How can I display the regular pages on a static page?
Something like: Get all site children that are not static?
I have the following page structure:
• Info (Static, defined as the frontpage in the backend)
• Projects (Static)
• Contact (Static)
• Project 1
• Project 2
• ...
In my index.php, I have:
Code: Select all
if ($WHERE_AM_I == 'page') {
if ($page->slug() == 'information') {
include(THEME_DIR_PHP.'info.php');
}
elseif ($page->slug() == 'projects') {
include(THEME_DIR_PHP.'projects.php');
}
else {
include(THEME_DIR_PHP.'page.php');
}
}
Code: Select all
foreach ($content as $page) {
echo $page->title();
echo $page->content();
}
Something like: Get all site children that are not static?