There may be times that you would like to show a page list that pulls in pages from multiple locations on your site. Now you can do that with a little change to a template.
Consider the following Site Map:
- Home
- Blog
- blog post 1
- blog post 2
- News
- news article 1
- news article 2
You'd like to show the latest 5 blog posts and news articles combined into one list on the home page. You could make both the blog posts and news articles the same page type, but try this instead:
Find the Page ID Numbers
Go to Dashboard -> Sitemap
Click on the Page Name that has the child pages you would like to display in the list (for example, 'Blog')
Mouse-over the 'Visit' link; you will see 'cID=###' where the hash marks are an ID number.
Write down the ID number
Do this for all of the pages you'd like to use (for example, 'News')
Duplicate the Template you wish to use
Copy the page list template that you would like to use; save it using whatever name you'd like (for example, 'home_page_list.php').
Modify the Template
Open the copied template file Place this code just above the HTML output:
filterByParentID(array(150,183)); if ($num > 0) { $cArray = $pl->getPage(); } else { $cArray = $pl->get(); } ?>
You will want to change the numbers in the array to the cID numbers you wrote down earlier.
Save the new template file
Using Your New Template
Go to the page where you'd like to use the new template (for example, 'Home')
Click 'Edit Page' at the top
Click the Page List where you'd like to use the template
Edit the Page List block and check the 'Everywhere' radio button. Click the 'Update' button.
Click 'Custom Template' and choose your new template name
Save the page.
It took me a while to figure this out; hope it helps you.