Posts by monkeyboy

    Hi all, Can anyone help?

    I have a Collection for Jobs and another for Locations, I'm using perch:related for the Locations so that this can be added to rather than just providing a select field.

    Code
    1. <p><strong>Location:</strong><br>
    2. <perch:related id="location" collection="Locations" label="Job Locations">
    3. <perch:content id="jobLocation" title>
    4. </perch:related>
    5. </p>


    Locations template used:

    Code
    1. <perch:content id="jobLocation" type="text" label="Location" required title>

    I can add content to both and display both on the page but I can't reuse jobLocation id to generate the slug it just doesn't output it.

    Code
    1. <!--* Build the url slug *-->
    2. <perch:content id="jobSlug" type="slug" for="jobTitle jobLocation jobReference" suppress>

    As a test, I've created two fields one using perch:related and one NOT inside a perch:related tag content added directly within the Jobs collection, you can see below that the related one doesn't display in the collection item list:

    What am I doing wrong? I also want to use the Locations field to be set as a variable which is passed into an application form. All of the below code works fine until I change Locations to use a perch:related tag and collection, any idea please?


    List and detail… detail page template below:

    This is the part of the code for job listing filtered by jobLocation, which now needs to come from the perch:related field:

    That worked perfectly, thank you!


    Have updated page to bodyclass too, thanks. Here's the full code for others:


    I'm trying to set the value of 'department' in a collection called 'Jobs', I want to use this variable inside a perch_layout to set as class on the body tag:

    Code
    1. if (perch_get('s')) {
    2. $department = perch_collection('Jobs',[
    3. 'template' => 'jobs/jobs_listing_department.html',
    4. 'filter' => 'job_slug',
    5. 'match' => 'eq',
    6. 'value' => perch_get('s'),
    7. 'count' => 1,
    8. ]);
    9. }

    The above outputs the department name as expected but displays on the page, I wanted to set/use it as a variable inside the below code:

    Code
    1. perch_layout('global.header', [
    2. 'title' => perch_page_title(true),
    3. 'page' => $department,
    4. // loads extra custom header default | ppc | no-module
    5. 'header-extra' => 'extra.header.job',
    6. ]);

    Then 'page' is used to add the department name as a class on the body tag.

    PHP
    1. <body class="<?php perch_layout_var('page'); ?>">

    The field used when adding a job to the Jobs collection template is:

    Code
    1. <perch:content id="department" type="select" label="Department" options="Accounts|accounts,Marketing|marketing,Sales|sales"/>

    Please does anyone have any ideas on how to do this?

    article template:



    listing template:



    Page links template:


    Code
    1. page links here: <perch:before><ul></perch:before>
    2. <li<perch:if exists="selected"> class="active"</perch:if>>
    3. <perch:if exists="spacer">
    4. <perch:pages id="page_number" />
    5. <perch:else />
    6. <a href="<perch:pages id="url" />"><perch:pages id="page_number" /></a>
    7. </perch:if>
    8. </li>
    9. <perch:after></ul></perch:after>

    Hi all,


    Using two page list and detail for a collection, I have the below code working except for pagination. 3 articles are displayed on the listing page and 1 on the news article view from the slug.


    For pagination test I have the listing only displaying 1 of possible 3 news items. But no pagination appears, template path is fine etc, any ideas?


    /media-centre/news

    /media-centre/news/article Routing: media-centre/news/[slug:s]


    Using Runway 3.1.5

    Show all:


    paging true
    total 3
    number_of_pages 3
    total_pages 3
    per_page 1
    current_page 1
    lower_bound 1
    upper_bound 1
    prev_url
    next_url /media-centre/news?page=2
    prev_page_number
    next_page_number 2
    first_page_url /media-centre/news
    last_page_url /media-centre/news
    first_page true
    not_last_page true
    page_links page links here: 1 page links here: 2 page links here: 3 {...}
    perch_item_first true
    perch_item_last true
    perch_item_zero_index 0
    perch_item_index 1
    perch_item_rev_index 1
    perch_item_rev_zero_index 0
    perch_item_odd
    perch_item_count 1
    perch_index_in_set 1
    perch_zero_index_in_set 0
    perch_first_in_set true
    perch_namespace perch:content


    Help greatly appreciated