Two page list and detail with other listings appearing in the sidebar of the detail page.

  • I have a jobs page on my website.

    I followed the instructions here: https://docs.grabaperch.com/pe…two-page-list-and-detail/


    I have a sub folder called opportunities. Within the sub folder I have two pages

    index.php which shows all of the listings and contains the following code:


    I then have a job.php that just displays a single job post that is clicked through from the index.php page. It contains the following code:


    Also on this page I would like to contain the latest three other jobs in a sidebar.


    Code
    1. <div class="col-sm-4">
    2. </div>

    I thought I would be able to use the code from the index.php page. So it would be like this:

    But it doesn't display anything at all?


    Could someone let me know where I'm going wrong please?

  • Hi


    You don't need to create a new region here as it's already created on the index page. You just need to tell Perch where to get the details from:


    Code
    1. perch_content_custom('Jobs', [
    2.     'path' => '/opportunities/index.php',
    3. 'template' => 'opportunities/job_listing.html',
    4.     'sort' => 'date', // Put the field ID you want to sort by here
    5.     'sort-order' => 'DESC',
    6.     'count' => 3,
    7. ]);
  • Hi,


    I've tried your code but it's still not displaying anything at all as I would expect.

    So in my job.php I have added the following:



    and in opportunities/job_listing.html I have

    Code
    1. <perch:content id="closingDate" type="date" format="%d/%m/%Y" label="Closing Date" />
  • I'm getting the following error with or without the sort options:


    So it's basically saying it can't find the Region 'Jobs'

    But in my opportunities/index.php I have:


  • I think I'm asking it to look in the correct page yes.

    So on my opportunities/job.php page I have:

    and in my opportunities/index.php I have: