Posts by SimonClay

    Again you are right Byron Fitzgerald !


    It seems a bit strange having to have template and skip-template in the custom query, but it works.


    Thank you.


    Code
    1. $result = perch_collection('301 Redirects', [
    2. 'filter'=>'old_url',
    3. 'match'=>'eq',
    4. 'value'=>$reqstring,
    5. 'count'=>1,
    6. 'template' => '301_redirects.html', //<-- added
    7. 'skip-template' => true,
    8. 'return-html' => true,
    9. ]);

    This great post form the old forum by Shane Lenzen shows how we can set up a Collection called 301 Redirects. In this Collection you can set page redirections!


    https://forum.grabaperch.com/f…p-301-redirect-collection


    However, I am finding that when the 404 is triggered I get a couple of PHP errors and I'd like to iron them out. Can anyone help?


    The errors are:


    Notice: Undefined offset: 0 in /Users/simonclay/Dropbox/Clients/Wycombe Homeless Connection/Wycombe Homeless Website/Site Folder/perch/core/runway/apps/content/PerchContent_Runway.class.php on line 426


    Warning: array_filter() expects parameter 1 to be array, string given in /Users/simonclay/Dropbox/Clients/Wycombe Homeless Connection/Wycombe Homeless Website/Site Folder/perch/templates/pages/errors/404.php on line 23


    The 404.php page code:


    Hi, I am finding that when I use


    Code
    1. <perch:content id="text" type="textarea" label="Text" html editor="redactor" imagewidth="686">

    Perch does not down-size and use the smaller image in the output. (I am uploading a wider image than the specified 686px).


    Is anyone else experiencing this?

    For my Post Page:


    For my 404 page:


    Currently in Runway, if a blog post is not found, the visitor sees a page with no content between the header and footer.


    We can use the <perch:noresults></perch:noresults> tags in perch/templates/blog/post.html to display a message like 'Sorry that item could not be found'.


    But really, the page should be re-directed to 404, don't you think?


    <?php perch_blog_post(perch_get('s')); ?> should do this by default in my opinion.

    This great post form the old forum by Shane Lenzen shows how we can set up a Collection called 301 Redirects. In this Collection you can set page redirections!


    https://forum.grabaperch.com/f…p-301-redirect-collection


    However, I find that the redirects only work on Pages, not when trying to redirect Blog items, or any other Collection item. I guess this is something to do with routing.


    Does anyone have any thoughts on how this could be overcome?