Posts by Joe Proctor

    Hi, I'm able to access the API data when using Perch on a subdomain (e.g api.mywebsite.co.uk) but not when it's in a subdirectory e.g (mywebsite.co.uk/folder).


    I can use Perch fine (in terms of logging in etc) in the subdirectory by changing the site path and login path in the configs, but the API doesn't work when visiting mywebsite.co.uk/folder/api/about for example.


    Is there a config setting where I can tell the API to look in the subdirectory and not at root level?


    Thanks.

    Yeah I think so!


    To keep Headless stuff in one thread. I'm grabbing 7 regions from one page which is working fine. However one of the regions has 7 items - but these are indistinguishable in the returned JSON. It returns 13 items in the array. I assumed it would return 7 items, but with the first item having 7 more items within it.


    The issue is the region that has multiple items, can have extra items added to it, so I can't grab anything based on ID. I've attached a couple of screenshots that may show the problem.




    Is there a quick solution to this do you know? Last resort I'll have it as 1 region with the element repeatable within it.

    Hi, is there an easier way to grab all regions of a page using the Headless API, rather than adding them all to a set?


    The following doesn't work but shows what I'm after:




    It works doing the following but isn't as futureproof as I'll have to add it into the API each time if I add a region:


    Code
    1. $Set->add_items($Regions->query('Header Block', [
    2. 'page' => '/about-page',
    3. ]));
    4. $Set->add_items($Regions->query('Block One', [
    5. 'page' => '/about-page',
    6. ]));


    Thanks.

    What about at template level? I've set new subpages use a specific Master Page but the regions on the subpage still allow a choice of templates.


    In the docs I can see it says "The setting New Pages Should Reference this Master Page, means that when new pages are created they will use the Master Page as a reference and any future changes you make to the Master Page design will be reflected in pages created from it – this is the most usual choice."


    I'm struggling to find that "New Pages Should" setting - any pointers? Thanks!