having to redeclare new regions

  • Hi all,

    When I upload changes I’ve made in Perch from local to live, I keep having to set up the region again and re-add the content.

    For example, I set up a “welcome” region so the customer can edit their welcome text on the home page. I go into Perch, I see the region load, I declare it as a “text block” template and then I can enter the content. It all shows correctly on the page.

    If I then add a new editable region, say “news” locally, then upload, the new region correctly shows, but the existing “welcome” also shows up as a new region and I have to keep redoing it. The old region is still in Perch but doesn't show on the web page. I've attached the screenshot which shows both regions. I'm not sure why one says "home" and one says "home page" in this case either.

    I am exporting the .sql file each time so db is up to date. And I am not changing the region names each time so <?php perch:content(‘Welcome’); ?> is unchanged.

    This is obviously at a simple level but it would be good to understand what I’m doing wrong now before I start developing this project deeper and adding more content.

    Does anyone know what I’m doing wrong please? Have I explained it well enough?

  • This is a better example attached. I added a new region called "Exhibition Section" and added the content locally.

    - I changed the page name locally to "Home page" to match the live server name in case that was the problem (why is there a difference, where is this set?)

    - Exported the .sql file to live server.

    - When I refreshed the home page, the content is gone and I need to set up the regions again.

    Thanks in advance...

  • ah ok thank you Clive. Would this be determined in the config.php file loginpath?

    Problem I seem to have is that on local it needs to be projectname/perch/ and live it needs to be just /perch/ and I'm not sure why. I'm assuming this will happen on every page...

  • I appreciate your efforts Clive, thank you.

    I'm attaching the live server screenshot of the location showing /index.php. This is what you're referring to?

    The local version shows projectname/index.php/ - when I change that to just index.php, it creates the new page with new duplicate regions again. It also deletes in the index.php page. When I resave the index.php file, new page, new region is created and the old location is back.

    I'm not sure if I'm still misunderstanding you (apologies if so) or if my local server configuration is wrong in some way. It's not my strong point ||

  • I don't recommend developing in a sub-folder like /projectname/. The local root of your site should be defined so that /projectname/ is not part of it. Otherwise, you will always have problems when you copy the site to live server where /projectname/ does not exist.

    I think this is why you are getting the duplication.

  • This does seem to be my issue as I've had this with other Perch projects. What is your setup to manage multiple websites?

    I use MAMP so it goes MAMP/htdocs/projectname/

    Perch then sits in the individual project..

    How/where is the local root defined to exclude the project folder?

  • You need to be able to define virtual hosts on your system so that each site has a site root that is not a sub-folder. There's a bit about that here,

    under "Keep your site root the same across all environments" - https://docs.grabaperch.com/pe…started/development-tips/

    I'm not sure you can do that with MAMP, you may need to use MAMP Pro. Or something else.