Posts by drewm

    Show PAGE Source showes greyed out <?php include(str_replace('/', DIRECTORY_SEPARATOR, 'editorial/templates/pages/ListsPagesTemplateObituaries.html')); ?>

    If the page source is showing PHP tags, then the server is not correctly configured to parse that type of file as PHP.


    You should show that problem to your host and ask them what you need to do to get the file to be parsed as PHP

    True, but I'm also using the return-html option. I'd want the layout included in the returned HTML.

    The HTML returned by return-html is processed in the same way with or without skip-template. The difference may come if your demo_collection() runtime function is not calling PerchTemplate::apply_runtime_post_processing() when skip-template is used.


    Quite a lot of the default functions will use skip-template as a queue not to call apply_runtime_post_processing() but then flip the switch back on if return-html is called.

    This generally works. However, it doesn't when using the skip-template option. I resorted to using a template handler instead.

    Could you clarify? If you're using skip-template then nothing in the template is used, including calls to layouts. So I'm clearly missing something!



    The custom name is used as expected in the pagination URLs in the template, but if I visit ?page=12, I'd get the 12th page for both Elephants and Unicorns; not just Elephants. So I'd have to refrain from using ?page= altogether to avoid unintentionally paginating something else on the page.

    Setting pagination-var should be enough! What do you have set for the paging key in your config/runway.php file?

    I have a problem whereby I am in Production mode but any change to a Perch template or linked file from a Perch template requires me to save when previously this has not been the case.

    It's always been the case (since pre-v1) that a standard perch_content() region saves its HTML output at edit time and won't update until it's next saved.


    That's not the case for perch_content_custom() calls, as they are generally dynamic and therefore rendered from the template live.


    None of this behaviour has changed. One thing that has changed in recent times is that PHP is now much more aggressive at caching the content of your files in recent versions. When you put Perch into development mode, we perform a few tricks to clear the PHP cache so that file changes show up instantly as you're working. You obviously want this caching behaviour in production as it makes your site faster and reduces load on the server.


    You can test out if this is what you're seeing by just waiting it out for a few minutes next time you see a change not taking effect.



    Is this the expected behavior since it is really tiresome having to upload an entire database

    You've lost me here... you're uploading a database?!

    That function was added in v3. You'll need to use this instead:


    Code
    1. if (perch_page_attribute('cards1', [], true) == '1') {
    2. }


    But you should also update to at least 2.8.34, or your site won't work with newer PHP versions.

    That <perch:else> isn’t actually doing anything above - it needs to be nested within a control structure to work.


    I’m not sure there’s an obvious way to perform category intersection from within a template. You possibly might be able to do it with a template filter, as the filter should be given access to other items in the same templated set. That would enable you to inspect both values and output accordingly. However, that’s theory - you’d need to try it to be sure.

    Yes, the title is constructed when the item is edited. If you change the settings after creating the title then it will have no effect.


    The alternative would be if we calculated every title every time an item is accessed, which would make your site very slow. Or we could update the titles when you change the region settings, which would make saving the region settings very slow. Considering this value will almost never change, it's not usually worth that tradeoff.

    You can certainly use a custom built app. But you build a custom app - not use the sample app. That's supposed to be an example - it's not production ready. It's full of nonsense "thing" classes.

    It's hard to say because I don't know what you're trying to do. You appear to have the Sample app mixed in with your page, which shouldn't really be happening. It's hard to offer any pointers.