Sky Blue Sofa Helpdesk How to create a new Page List Plus template - Sky Blue Sofa Helpdesk

How to create a new Page List Plus template

June 23, 2014 at 8:44 AM

In an effort to make Page List Plus as easy as possible for developers, I have made the templates modular so you can mix and match the things you need.

How to change the HTML code of your Page List Plus template

  1. Locate the {root}/packages/skybluesofa_page_list_plus/ folder on your site. We'll call this the PLP_package folder
  2. Now find the PLP_package/blocks/page_list_plus folder on your site. We'll call this the PLP_block folder
  3. In the PLP_block folder, you'll find a templates folder. Create a new folder here. Name it something memorable for your new template.
  4. Copy the PLP_block/view.php and PLP_block/view.css files into this new folder
  5. Open the PLP_block/{your_template_name}/view.php file. You'll see a line that looks like this:
    <?php echo Loader::element('results', array('controller'=>$controller), 'skybluesofa_page_list_plus'); ?>

    This is the code responsible for showing the actual pages for the Page List Plus block. For our purposes, change the 'results' in this code to 'results_my_template'.
  6. In the PLP_package/elements folder, find the results.php file. Copy it and rename the copy 'results_my_template.php'
  7. Open the 'results_my_template.php' file. This is the code that loops through all the pages returned and shows the HTML for them. To edit this file, you'll probably need some HTML, PHP and concrete5 coding experience.
  8. Once you've updated your new 'results_my_template.php' file, you'll want to update your Page List Plus block to use this new template.
    1. Find the Page List Plus block on your site that you want to use this new template.
    2. Edit the page
    3. Click the Page List Plus block. Choose 'template' from the menu. Choose {your_template_name} from the dropdown.
    4. Save the template. Save the page

Categories: Page List+
  0     Have marked this Article as Helpful