Working in Plangku

Saving, history and publishing

How saving works, what happens when two people edit, how to compare and restore, and how theme code goes live.

Saving

Press ⌘S (Ctrl+S on Windows and Linux) to save the file you have open. Press ⌥⌘S or ⇧⌘S to save every unsaved file. When more than one file is unsaved, a Save all button appears in the title bar too.

A file with unsaved changes has a dot in the Explorer and the status bar says "Unsaved". Closing its tab asks you first, and so does leaving the page.

Saving puts the files in the website's draft. Visitors do not see anything yet.

Errors block saving

When you save, Plangku builds the whole theme, not just your file. If any file has an error, nothing is saved and the message says "Not saved: fix the errors first". This keeps the website's theme in a state that always works.

  • The Problems panel lists every problem with its file and line. Open it with ⌘J or the counters at the bottom left. Click a problem to jump to it.
  • The editor also checks open files as you type.
  • Warnings, such as a CSS rule that was left out, do not block a save.

See Files and structure for the usual causes.

Two people editing

Each save checks that nobody else saved theme code since you opened the editor (or last loaded it). If someone did, your save is refused and you see The theme code changed elsewhere.

  • Choose Load their changes to fetch the latest files. Your unsaved edits stay in their tabs, still unsaved. Look them over, then save again.
  • Choose Not now to keep working. The next save will ask again.

The check covers the whole theme, not one file. So two people can conflict even when they edit different files. Only the person who saves first wins. Nothing is merged for you.

If you have the visual editor open in another tab, it picks up your saved theme code on its own.

File history

Every save of a file is kept. The kinds you will see:

LabelWhen
CreatedA new file
SavedAn ordinary save
DeletedA file was deleted
RestoredA version was put back
Theme uploadA package replaced the files
AI changeAn accepted change from the code assistant
CustomizedA built-in section was copied into the theme
From a versionThe files came back from a whole-theme restore

Plangku keeps the newest 40 saves of each file, with the person's name and the time. A save that changes nothing is not added.

To use it:

  1. Click the clock icon in the left bar to open History.
  2. With a file open, you see that file's saves. With no file open, you see the latest saves of every file.
  3. Click a save. A comparison opens, with the saved text against the file as it is now.
  4. Click Restore this version to put it into the editor.
  5. Save with ⌘S to keep it. Until then, nothing changes.

To bring back a deleted file, find an earlier save of it in the "all files" list, compare it, and restore it. Deleting a file always asks for confirmation and mentions this.

Restoring the whole theme

The website has its own version history: automatic versions while you edit, a version for every publish and any version you name. These versions include the theme code.

Under Whole theme in the History panel, each version has a Restore code button.

  • Every theme file is replaced by that version's files. A file that was not in that version is deleted.
  • Pages, text and design stay as they are.
  • Before it restores, Plangku saves your current theme code as a version called "Before restoring theme code". You can undo by restoring that.
  • If the old files no longer work with the current platform, nothing is changed.
  • A version made before the website had any theme code has none to restore.

Restoring a whole website version from the visual editor's history brings back its theme code as well, when the version has it.

Before a save, if the website's latest version is more than 15 minutes old, Plangku makes an automatic version of the state before the save. So there is a restore point at the start of an editing session and then about every 15 minutes.

Publishing

Theme code, like pages, has a draft and a live copy.

  • The code editor, the preview and the visual editor all show the draft.
  • Visitors see the live copy, which is what existed at the last publish.

Publish copies the draft to live in one step. It publishes theme code, pages, header, footer and theme design together, so a page that uses a new section never goes live without the section's file.

You can publish from the Publish button in the code editor's title bar or from the visual editor. It needs the Publish permission. A member who only has Theme code can edit and save but not publish.

Publishing uses the saved draft. Text you have typed but not saved is not included, and the editor asks before it publishes with unsaved files.

How to tell what is not live yet:

  • The status bar shows "N files not published".
  • In the Explorer, a changed file has an orange name and an M.
  • The Publish button says Published and is off when everything is live.
Tip: Plangku keeps a version for every publish. If a publish goes wrong, restore the theme code from the version before it, check the preview, and publish again.