Posts by richythomas

    While using Perch Blog I have decided that on each post.php page I want to include the latest 3 blog posts underneath my main post.

    I'm using code:


    PHP
    1. <?php
    2. perch_blog_recent_posts(3);
    3. ?>

    But if I am viewing one of the 3 latest posts then the post still appears in the latest 3 (As it is technically one of the latest 3). Is there anyway to exclude the current post that I'm on from the recent posts list?

    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:


    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:


    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 would like to do the same with an event. I tried using the code above but modified it for events but the Event title isn't coming through.

    So in my event.php file I have



    In my listing/event-detail.html I have:

    Code
    1. <h1 class="summary margin-bottom-20"><perch:events id="eventTitle" /></h1>

    and in my forms/register-your-interest-to-an-event.html I have

    Code
    1. <perch:input type="hidden" id="eventFormTitle" label="Event Title" />

    I thought the same code would work.. Just wondering if because maybe it's using the event app that it may need to be slightly different?

    Any help would be very much appreciated.

    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?

    Following on from my previous post. Was wondering if I could get some help.

    I have a page called job.php which contains the following:

    PHP
    1. <?php
    2.     perch_content_custom('Jobs', array(
    3.         'page' => '/opportunities/index.php',
    4.         'template' => 'opportunities/job_detail.html',
    5.         'filter' => 'slug',
    6.         'match' => 'eq',
    7.         'value' => perch_get('s'),
    8.         'count' => 1,
    9.     ));
    10. ?>


    In my job_detail.html template I have a perch content area for Job Title:

    Code
    1. <perch:content id="jobTitle" type="text" label="Job Title" required="true" title="true" />


    I have a form with the template: apply_for_job.html that contains: (I used different ID's to avoid confusion)

    Code
    1. <perch:input type="hidden" id="jobFormTitle" label="Job Title" />


    I would like to pass the perch:content id="jobTitle" from my job_detail.html template into my apply_for_job.html (form template) via the job.php page.


    From the discussion above I know I need to have the following:


    PHP
    1. <?php $jobTitle = 'Job Title Goes Here'(true); ?>
    2. <?php PerchSystem::set_var('jobFormTitle', $jobTitle); ?>
    3. <?php perch_content('Apply For Job Form'); ?>

    The problem is I can't work out what I need to put in the 'Job Title Hoes Here' bit..

    Can anyone help?

    Ok so I've got one where I'm trying to pass a type of condition through to a form.

    In my conditions.php master page template I have:


    PHP
    1. <?php PerchSystem::set_var('condition', $pageTitle); ?>
    2. <?php perch_content('Common Ailments Form'); ?>


    Then on the Common Ailments Form I have

    Code
    1. <perch:input type="hidden" id="condition" label="Condition" />


    I have setup a page with the Page title 'Acne'


    So it should be passing Condition: Acne in the form submission.

    Instead I'm getting an empty field:


    Any ideas?

    One other question.

    If wanted to create a page template and I wanted to pass through the 'Page Title' that's created in Perch Admin as the variable.

    Is that possible. e.g.

    I create a page using a page template called 'Birmingham'


    The page template contains the following:


    PHP
    1. <?php PerchSystem::set_var('pharmacyName', 'Page Title'); ?>
    2. <?php perch_content('Pharmacy Contact Form'); ?>


    So that the value that gets set is the Page Title.. in this case 'Birmingham'

    Thanks for the speedy repsonse.

    So this works with perch:form aswell?

    So on my page I could have:


    PHP
    1. <?php PerchSystem::set_var('pharmacyName', 'Birmingham'); ?>
    2. <?php perch_content('Pharmacy Contact Form'); ?>

    and then in my form template:


    Code
    1. <perch:input type="hidden" id="pharmacyName" label="Closest Pharmacy">


    And that would pass that value into the hidden form field so that it passes that value to the output of my form.

    So:

    Closest Pharmacy: Birmingham


    Is that correct?

    I have a perch form that I want to include on several pages.


    The reason I'm including it on multiple pages is I want to use exactly the same form fields.. except one.


    I have a field called My Closest Pharmacy. There are seven options in this select dropdown.


    Depending upon what page you're on.. I would like this field to be pre populated. Either with the correct option for that page selected. Or even as a hidden field where the value is passed through to the form submission in the background.

    So if for example.. If I am on the Newport Pharmacy page. I want the value 'Newport' to be passed into this field. If I'm on the Cardiff page then the value needs to be 'Cardiff'


    I don't want the user to have to manually select the Pharmacy themself.

    What is the best way to do this using Perch? Or would I need to create Several almost identical forms just to have this one different field?

    Having problems sending emails from Perch.

    Went to the email settings to check and I get a blank page. (See screenshot)

    The Perch from email is set to: stmarysrc@blaenau-gwent.gov.uk which is a schools email that's probs got all sorts of email filtering going on.. so thought that may be the issue so changes to my server email that I know works for other sites but still nothing.


    Have attached diagnostics report

    Any ideas?

    ss.png


    I'm using a perch if statement to add a class to a span depending upon which checkbox is selected.

    Problem is I have 19 potential colours that can be selected so checkboxes are not the best option for my users.

    Is there anyway I can have like a select dropdown box where depending upon what's selected will add that class to the span class.


    Here's my code


    All the files were there.

    I think it was an issue with the PHP version. Even though I had set it to 7.2. The change hadn't yet been applied for some reason.


    I think there's also an issue I'm having now with the sub domain and the SSL encryption. Everything is running very slow and sometimes timing out completely.


    Has anyone else ever has this happen?