This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

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

  1. Go to Dashboard -> Sitemap

  2. Click on the Page Name that has the child pages you would like to display in the list (for example, 'Blog')

  3. Mouse-over the 'Visit' link; you will see 'cID=###' where the hash marks are an ID number.

  4. Write down the ID number

  5. 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

  1. 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

  1. Go to the page where you'd like to use the new template (for example, 'Home')

  2. Click 'Edit Page' at the top

  3. Click the Page List where you'd like to use the template

  4. Edit the Page List block and check the 'Everywhere' radio button. Click the 'Update' button.

  5. Click 'Custom Template' and choose your new template name

  6. Save the page.

It took me a while to figure this out; hope it helps you.

Loading Conversation