menu_book Documentation expand_more

website integration

A few small conventions let Sitecake fit any hand-built site without changing how you work. You keep writing plain HTML — Sitecake just learns which parts are editable.

Website structure

Once you download and extract the Sitecake archive, it looks like this:

sitecake/
sitecake.php

The sitecake/ folder contains the CMS code and configuration. sitecake.php is the entry point for editing. Sitecake alone is not operational — you must have at least an index page, with at least one editable div to start editing.

sitecake/
sitecake.php
index.html

With an index file and one editable div inside, you will be able to add new content: headings, text, lists, videos…

<!DOCTYPE html>
<html>
  <head></head>
  <body>
    <div class="sc-content"></div>
  </body>
</html>

Once you log in to http://yourdomain.com/sitecake.php, add some content and click publish, your files on the server will include:

files/
images/
cms-backup/
cms-temp/
sitecake/
sitecake.php
index.html

Sitecake created these folders automatically:

  • files/ — for saving uploaded files (PDFs, for example)
  • images/ — for saving uploaded images
  • cms-backup/ — backups. After each publish, Sitecake makes a snapshot of all files and saves copies under a date-stamped folder, making rollback possible.
  • cms-temp/ — for draft pages, uploads-in-progress, and log files

Disallowing certain files

If your website contains directories or files that should not be managed by Sitecake, create a .scignore file in your site root and list them, one per line.

By default, Sitecake only checks .html, .htm, .php and .php5 files (this can be changed through configuration).

framework-dir/
wordpress/
some-file-not-managed-by-sitecake.php
some-file-not-managed-by-sitecake.html
subfolder/some-file-not-managed-by-sitecake.html

Page structure

The sc-content CSS class added to an HTML tag makes that tag a wrapper for editable content. Existing code within the wrapper becomes initial content once Sitecake loads.

Sitecake currently supports these content types:

  • h1-h6 — headings
  • p — paragraph
  • ul — unordered list
  • img — image
  • a — links (inside p, h1-h6 or ul)
  • sc-gallery — multi-image gallery with a lightbox on published pages
  • video — embedded YouTube / Vimeo
  • sc-map — embedded Google Maps
  • file — uploaded document with a download link
  • HTML — a raw HTML block

There are two types of sc-content containers:

  • Basic container sc-content — simply editable parts of a web page.
  • Repeater container sc-content-name — content that repeats across pages. Edit it once, and Sitecake syncs the change everywhere.