perch_content_custom and shared region

  • I have a site where the editor can create pages.

    At the top of each of these pages is a pricelist and this is edited using a shared region.

    It is displayed on each page using a template with the code below.

    Further down each of the pages, I want to populate a call to a shopping cart with the same sizes and prices from the pricelist shared region. Can anyone advise me on the best way to do this? I have tried perch_content_custom but failed.

  • Yes, you can use perch_content_custom for this. If your region is shared, you need to set the page option to *

    1. <?php
    2. $values = perch_content_custom('Region name', [
    3. 'page' => '*',
    4. 'skip-template' => true,
    5. ]);