Posts by hus_hmd

    -- /perch/phpinfo.php

    -- /perch/resources/phpinfo.php

    Perch does not ship with these files as Clive Walker mentioned.

    I'm not sure what they mean by "response headers".

    You can check the response header with your browser's DevTools. You can learn more about them:…/Glossary/Response_header

    X-Powered-By is a common non-standard HTTP header that some servers send along with their response headers. The header often provides information on the type server and in your case the version of PHP installed. Disable this header (and review the other headers the server sends) or ask your web host to do so.

    Also is there a way to include similar matches? As when I search tree, only items with 'tree' appear, the items with 'trees' do not.

    The example I used above uses the contains filter. It performs a simple search in which it looks for exact matches.

    If you need something a little more sophisticated and you are comfortable with regular expressions, you can use the regex filter. For instance, the regex (?i).*(tree).* would match any word containing the string tree (e.g. trees, street). So this may not always return relevant results.

    If the goal is to just include plurals, one option could be to search for both the entered term and the (possible) plural form with a regex \btree\b|\btrees\b:

    Is there a way to include filtering for tags and categories?

    The documented method for tag and category filtering is to use the tag and category options:

    1. perch_blog_custom([
    2. 'category' => ['category-path'],
    3. 'tag' => ['news'],
    4. ]);

    However, I don't think the above would be a good fit for your use case as it will only return posts that match the category/tag filters as opposed to making it optional.

    Instead you should be able to filter by postTags and _category like the other fields:

    If perch_blog_custom() is the suitable option for your use-case, you do not need to use the layout blog_search_results.php as it will make redundant database queries.

    The reason the layout is used in the original solution on this thread is because perch_content_search() does not make all the fields of a blog post available. On the other hand perch_blog_custom() does.

    The following renders the result using the template perch/templates/blog/post_search_result.html:

    Your post_search_result.html template can include all the tags you need:

    You can use the same pagination tags you had in your previous comment, but you'll need to use the perch:blog namespace instead of perch:search for your template tags.

    As for the total number, when you enable pagination, Perch makes a number of pagination variables available to you in the template including total:

    I just want to note that the initial solution on this thread is meant for a search form that searches all your site's contents, not just the blog:

    1. <perch:if id="result_source" value="PerchBlog">
    2. <!--* Search result from the Blog app *-->
    3. <perch:layout path="blog_search_result" url="<perch:search id="result_url">">
    4. <perch:else>
    5. <!--* Everything else *-->
    6. <!--* you are meant to display other results here and not leave it empty *-->
    7. </perch:if>

    If you only need to search the blog posts, it is probably easier to use the filtering options with perch_blog_custom():

    If you must use perch_content_search(), but still need to restrict the search to the Blog app (instead of performing the filtering inside the template):

    1. perch_content_search(perch_get('q'), [
    2. 'apps' => ['PerchBlog'],
    3. ]);

    I've just come across another issue. When there are multiple pages of results (I currently have the count at 9), no results show on the other pages, however it is saying there are 3 pages.

    If you use conditional tags to filter the results inside the template like this, you cannot reliably using pagination. This is the expected behaviour. I noted this in a blog post.

    • Does your search form only search blog posts, or does it search other content on the website too?
    • Do you use the default blog post fields (as shipped with the Blog app), or do you use custom fields?

    All page requests on a Runway site go through start.php, but it does not redirect to it. To clarify, do you get redirected to /perch/core/runway/start.php when you visit the root of your site /.

    And is this a site you have upgraded from regular Perch to Runway?

    I hope to be able to confirm some exciting news about the next steps for Perch, but unfortunately it's not quite there yet. As soon as we're able to tell you about it, we will.

    We all love some good news. The longer we wait, the higher the expectations :S

    Have you (or the hosting provider) checked the server logs when these crashes occur?

    If you cannot replicate this in a different environment, I'd try to narrow it down as much as possible. Even checking what type of content (page, region, category, etc) that is saved when this happens and what field types are used on those may provide some insight and you may be able to see some patterns.

    Hi Loudon,

    If this is a multiple-item region:

    • Click on the region
    • Click on the "Region Options" tab
    • Select the columns from the field labelled "Item list columns"

    I don't see orderInvoiceNumber being used in the template, so I'm assuming you removed on purpose after you found it didn't work. Does the table shop_orders have the orderInvoiceNumber column? And is it populated for the orders in the table?

    Also, is it possible to pass information into this template from another page within the site? It would be useful to have the company contact details available from the contact page.

    You could try using a layout include for this.