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:
- <?php
- perch_content_create('Jobs', array(
- 'template' => 'opportunities/job_detail.html',
- 'multiple' => true,
- 'edit-mode' => 'listdetail',
- ));
- perch_content_custom('Jobs', array(
- 'template' => 'opportunities/job_listing.html',
- ));
- ?>
Display More
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:
- <?php
- perch_content_create('Apply For Job Form', [
- 'template' => 'forms/apply_for_job.html'
- ]);
- $result = perch_content_custom('Jobs', array(
- 'skip-template' => true,
- 'return-html' => true,
- 'page' => '/opportunities/index.php',
- 'template' => 'opportunities/job_detail.html',
- 'filter' => 'slug',
- 'match' => 'eq',
- 'value' => perch_get('s'),
- 'count' => 1,
- ));
- if(!isset($result[0])) {
-
- }
- $job = $result[0];
- $job_html = $result['html'];
- $title = '';
- if(isset($job['jobTitle'])) {
- $title = $job['jobTitle'];
- }
- echo $job_html;
- PerchSystem::set_var('jobFormTitle', $title);
- perch_content_custom('Apply For Job Form');
- ?>
Display More
Also on this page I would like to contain the latest three other jobs in a sidebar.
- <div class="col-sm-4">
- </div>
I thought I would be able to use the code from the index.php page. So it would be like this:
- <div class="col-sm-4">
- <?php
- perch_content_create('Jobs', array(
- 'template' => 'opportunities/job_detail.html',
- 'multiple' => true,
- 'edit-mode' => 'listdetail',
- ));
- perch_content_custom('Jobs', array(
- 'template' => 'opportunities/job_listing.html',
- ));
- ?>
- </div>
Display More
But it doesn't display anything at all?
Could someone let me know where I'm going wrong please?