Posts by ellimondo


    You can also filter inside that each function. Related fields use a dot to denote the related field parent.


    You'll need to share your diagnostic data and any templates you are using in order for someone to help you.

    Best way to diagnose this is to take the site offline, backup your DB and run the perch debug script so you can see if anything's missing. Sounds like you've got files missing and trying to do this on a live site is not recommended.


    When you add an image to any edit page then it is generally sized according to the settings in the assigned template. In this case it will probably be templates/blog/post.html. You'd need to edit this template to resize and crop the image to suit your design.

    You can either edit the default field type, or even add multiple field types using the same id and Perch will generate those when you upload an image. This way you can generate, for example, a thumbnail and a main image from the same image at the same time, and use them in different places on your site.


    I think you need to speak to the host first if you've got folder permission issues. You're right in saying that the resource folder isn't writable but that won't be down to Perch. You should be able to (re)set the folder permission in the host control panel but sometimes on shared hosting it needs a swift kick from tech support!

    When you say function do you mean nothing shows up in the product edit screen?

    You should get a dropdown menu showing all the categories in the products set. Make use that the set id matches what you've added into the Category app. You can only list categories from one set within one perch:categories pair of tags so you will need to use multiple pairs if you have more than one set of categories.

    As an aside, because product pages tend to be quite complex, it might be easier for you to have one template for editing the products and another for displaying them. Then you don't need to worry about suppress or conditionals cluttering up your product edit template.


    I believe your filter value needs to be equal to a Perch field ID. You could try using `'match' => 'regex',` and use a PCRE expression that mirrors your requirement as the value e.g. `^2` – NB I am not good at REGEX so this might not be right for you!

    <perch:showall> is your friend! You'll then see which options are available to that variant with <perch:if exists="variant_id">and create your conditions based upon their existence. You'll need to do this inside the <perch:variants></perch:variants> tag pairing of course.


    Are you using this in a content (html) template? <perch:content… can't go in a page (php) template.

    A good way to test it might be to render the image tag outside the section first so the image path displays on the screen and then move it into the section style attribute once you know it's working.

    Also your section and style tag don't look closed to me in your screen grab. It's missing the ')"> but that might just be the image. Best to post the actual code for clarity's sake.



    This issue has reared its head again – but I've only just seen the error when the site is being edited by the user.

    The template tag is this: <perch:content id="seminar_start" label="Start time" time type="time" format="H:i:s" default="09:00">

    Time is imported using the API as 9:50 into a collection.

    This then saves as 2019-07-29 09:50:00 in the database:

    When the collection item is saved again the field returns this to the initial format. e.g. 9:50

    So the item is now out of order in the listing as the format has changed (to what it should be).

    I can just use a text field as I only need the time but it would be nice if the importer kept to the format set in the template – or alternatively didn't change the actual data format once saved. Is this possible?

    Yeah, thanks hus_hmd, that's what I thought. I build the front-facing page first as the pdf generator was user-facing. However the query and pdf build is so slow I want to move it into the back end. I don't have the time / budget / will to live / left to work on this any longer so I will have to just rely on the scheduled task!


    I have a template page that generates a pdf using mpdf library and several Perch collections.

    I now have made a little app that imports a csv to populate those collections. This works great.

    I have set up a schedule task with a function that fetches the page every 12 hours and therefore generates the pdf. This works fine as well.

    I now want to also fetch the page when the import is finished – so that a new pdf is regenerated from the new data.

    When I try to include the page in the app's form page I get the error: Fatal error: Uncaught Error: Call to undefined function perch_collection().

    I guess I can't access runtime functions from an app. So how can I do that? Or am I approaching this from the wrong direction :/? Answers on a postcard much appreciated…

    Your link is relative, meaning that the link will use the current page as its starting point.

    If you start your link with a forward slash <a href="/ then link will use the site's root as its starting point.

    So if you start your link with <a href="/blog/ then the link will always point to the blog folder, which is where your archive page is located.

    Hi Andrew

    I think you probably need to check if the form has been submitted before calling the perch_shop_checkout function.

    I have the following in a checkout page using Stripe - I've only done this once so cannot claim to be an expert (no change there).

    I don't have any additional javascript - I think that's already done with the stripe function in Perch Shop but I'm not 100% sure.

    This bit of code in the head of the page template (before anything else) checks is the member is logged in and gets a token from the form once the user is returned from Stripe. It also controls where the user gets redirected depending on the status of the transaction.

    Then in the body you place

    1. perch_shop_payment_form('stripe');