All posts with Stacey tag

It appears Stacey 3.0.0 has issues with generating urls for child pages on some occasions. When this problem is encountered, Stacey appends additional trailing slashes onto the child URLs, which when followed results in the URLs of internal site links in the destination page being incorrectly rooted.

Rather than delve into the guts of this system, a quick and dirty work-around can be gained by editing the root .htaccess file. The following entries should resolve the problem:

# Remove multiple slashes after domain
RewriteCond %{THE_REQUEST} ^[A-Z]+\s//+(.*)\sHTTP/[0-9.]+$ [OR]
RewriteCond %{THE_REQUEST} ^[A-Z]+\s(.*/)/+\sHTTP/[0-9.]+$
RewriteRule .* %{ENV:proto}://%{HTTP_HOST}/%1 [R=301,L]

# Remove multiple slashes anywhere in URL
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]

    Another site I maintain ( used to be built from static html pages. Last year Google encouraged websites to become phone-friendly - this seemed a good opportunity to move this site into the 21st Century. After a lot of work, especially in converting rtf content into yml, the site has been morphed into one managed by the Stacey 3.0.0 CMS and given a bootstrap based theme.

      The Stacey 3.0.0 CMS provides the ability to search for text within pages making up the website it generates.

      By default this functionality is limited to the fields 'url' 'file_path', 'title', 'author' and 'content'

      For sites that make use of additional fields, any content within them is not included within a search. To make all text available to search, filtering within the create_full_cache function needs to be removed.

      To achieve this open the /app/ file, navigate to the create_full_cache() function, remove the $search_fields variable and the loop that removes entries form the $current_page collection when their key is not present in $search_fields.

      A modified version of the function follows:

      static function create_full_cache($pages = null) {
        $store = array();
        if (!isset($pages)) $pages = Helpers::file_cache('./content');
        foreach ($pages as $page) {
          if ($page['is_folder']) {
            $current_page = AssetFactory::get($page['path']);
            # Skip for password protected pages
            if (isset($current_page['password_protect']) || isset($current_page['hide_from_search'])) continue;
            $store[] = $current_page;
            $children = self::create_full_cache(Helpers::file_cache($page['path']));
            if (is_array($children)) $store = array_merge($store, $children);
        return $store;