How to convert webpages using PageLime Stacks for RapidWeaver to static content


#1

If you’re coming to Surreal CMS from PageLime and your website uses the PageLime Stacks plugin for RapidWeaver, this post will show you how to convert your webpages to static content so they work properly with Surreal.

Symptoms

  • You publish changes, but the changes don’t show up on the live site.
  • You publish changes, but get an error similar to this: The following regions could not be updated: Pl Stacks ln 1 Page6

Cause

Your website uses PageLime Stacks for RapidWeaver, but Surreal doesn’t support this plugin. (Note: we’ve reached out to the plugin’s author, but he unfortunately wasn’t interested in making this work with Surreal.)

Solution

The solution is to convert these regions to static content. First, open up the live webpage in a new tab. Keep this open so you can refer back to it later.

In the source of each page, look for one or more blocks that are similar to the one below and remove them. (You can access the source of each page using an FTP client or in Surreal by going to Edit > Edit Page Source from the editor.)

<?php 
require_once(file_exists('/cms-assets/cms_interface.php') ? '/cms-assets/cms_interface.php' : 'files/cms_interface.php');
cms_register();
function callback_stacks_in_1_page6($buffer) {
  $user_content = get_html('pl_stacks_in_1_page6');
  return (($user_content != null) ? $user_content : $buffer);
}
ob_start("callback_stacks_in_1_page6");
?>

For each block you remove, there will be a matching line like this. Be sure to remove those too:

<?php ob_end_flush(); ?>

Now save the source and open the page for editing in Surreal CMS.

Compare the content in the editor to the content on the tab you opened up earlier. The content may not be up to date! However, you can simply copy and paste from the original tab if you need to.

Before you get started, here are a couple things to consider:

  • Always make a local backup before editing files on your web server!
  • By moving to static pages, you will no longer be able to make changes in RapidWeaver and publish back to Surreal without overwriting your content.

Content Changed in Source but Not Updating When Published