Documentation

Failed to locate content region

Publishing finished, but Surreal CMS couldn't find one or more content regions in your page's file, so the changes to those regions weren't published. The dialog lists each one by its id, with this message:

Failed to locate content region.

Your changes aren't lost. They're saved in a revision, so you can open it from Drafts & Revisions and publish again once the region is fixed.


Why it happens

The editor shows your page the way a browser sees it. Publishing changes the page's file on your server. When a region is in the browser but not in the file, there's nothing to update.

  • The region is in an include Surreal CMS can't follow. Surreal CMS follows PHP includes and Server Side Includes with a plain, quoted path. A path built from a variable or a constant, such as include __DIR__ . '/footer.php';, won't work, and neither will an include inside another include. Only the first Server Side Include on a page is followed. Absolute paths start at the folder your connection opens in, so they only work when that's also your web root. See Dynamic includes.
  • Code creates the region. If server-side code, a template, or JavaScript writes the region's HTML, the region isn't in the file. Put it in the page's HTML instead.
  • The file changed after you opened it. If someone edited the file with another app and changed or removed the region's id, reload the editor.
  • The editor and the publisher see different files. This happens when the site's home folder doesn't match its URL, or when your server shows a different file at the page's address. Compare the file on your server with the page in a browser.

How to fix it

  1. Open the page's file on your server and search for the region's id.
  2. If it isn't there, find where the region comes from and move it into the file, or into an include with a plain path.
  3. Reload the editor, open your changes from Drafts & Revisions if you need them, and publish again.

If you're still stuck, contact us and tell us which site and page you're publishing.