File editor, versions and export
How to create and edit the files of a hosted landing page or offer in the panel, upload images, save code versions and download a ZIP.
The editor opens the files of a hosted landing page or offer right in the panel: in the Landing pages («Лендинги») or Offers («Офферы») section, click Editor («Редактор») in the row of the page you need. External landing pages and offers do not have this button. Uploading an archive and its limits are described on the Hosted pages page. The owner, the admin, the team lead and the designer can see the button. In the landing page list on a phone, it is called Code («Код»).
The editor screen
Above the editor are these buttons:
| Button | What it does |
|---|---|
| ← To landing pages («← К лендингам») / ← To offers («← К офферам») | Returns to the list |
| Open ↗ («Открыть ↗») | Opens the page in a new tab at its direct address. Visible when there are files |
| + File («+ Файл») | Opens the “New file” («Новый файл») window |
| Export ZIP («Экспорт ZIP») | Downloads the code as an archive |
| Versions («Версии») | Opens the “Code versions” («Версии кода») window |
| Upload .zip («Загрузить .zip») | Replaces all files with the contents of the archive |
On the left is the tree of folders and files with the heading “files · N” («файлы · N») and the + file («+ файл») and ↑ files («↑ файлы») links. On the right is the open file: its path and the Rename («Переименовать») button, plus Save ⌘S («Сохранить ⌘S») for text files.
When it opens, the editor selects the index.html or index.php closest to the root, or, if there are none, the first text file. While there are no files, instead of the tree you see the Drag a .zip or files here («Перетащите .zip или файлы») area and the Create file («Создать файл») button.
Creating a file
- Click + File. To create a file directly in a folder, hover over the folder in the tree and click +.
- In the “New file” window, choose an option in the Template («Заготовка») block.
- Check the File path («Путь файла»): the field is filled in from the selected template. If needed, enter your own name, for example
index.phporcss/extra.css. Missing folders are created automatically. - Click Create («Создать»).
The message “File created” («Файл создан») appears, and the file opens in the editor.
There are six templates:
- HTML page («HTML-страница») — a page skeleton with a “Go” («Перейти») link; it loads
style.cssandapp.js; - HTML + lead form («HTML + форма лида») — a page with a name and phone form that sends the data to the tracker together with
{click_id}— see Receiving leads from forms; - CSS, JavaScript, PHP — starter code for a file of that type;
- Empty file («Пустой файл») — a file with no content.
In the HTML page template, the “Go” link points to {offer_url}. On a landing page, replace this value with the {offer} macro — see From landing page to offer and multi-offer. Other macros are on the Macros in links and pages page.
File and folder names cannot start with a dot. If the path is taken, the window shows “A file with this path already exists” («Файл с таким путём уже есть»).
Editing and saving
- Click a file in the tree.
- Make your changes. The “● not saved” («● не сохранено») mark appears next to the path.
- Click Save ⌘S or press Ctrl+S (Cmd+S on a Mac).
The message “Saved” («Сохранено») appears. You do not need to publish changes separately: a saved file immediately replaces the previous one on the server.
How the editor opens files:
- As text — files with the extensions
html,htm,css,js,mjs,cjs,json,php,phtml,txt,xml,svg,md,csv,ts,tsx,jsx,scss,less. - As an image —
png,jpg,jpeg,gif,webp,ico,avif,bmp. - Other files do not open: “Binary file — cannot be edited as text” («Бинарный файл — нельзя редактировать как текст»). The Open in a new tab ↗ («Открыть в новой вкладке ↗») link shows the file at its direct address.
- A text file larger than 5 MB does not open: “The file is too large for the editor” («Файл слишком большой для редактора»). Edit it on your computer and upload it with ↑ files — the file goes to the page root.
- A file that is not in UTF-8 opens read-only. Convert it to UTF-8 and upload it again.
Before you switch to another file, create a file, upload files, rename, restore a version or return to the list, the editor asks whether to discard unsaved changes.
Uploading images and other files
- Click ↑ files above the tree.
- Choose one or more files.
The message “Files added: N” («Добавлено файлов: N») appears, and the first of the added files opens. Files go to the page root. Existing files stay, and a file with the same name is replaced by the new one without confirmation. To move a file to a folder, rename it — see below.
The Upload .zip button does not add files: it replaces all the code with the archive. If there are already files, the editor asks for confirmation, and unsaved changes are lost. The previous code is saved as a separate version — see ZIP upload.
Renaming and deleting
To rename a file or move it to a folder:
- Open the file.
- Click Rename.
- In the “New file path” («Новый путь файла») window, enter the path, for example
img/banner.png. - Confirm the input.
The file appears in the tree at the new path, and the needed folders are created automatically. A taken path is not overwritten: an error message appears above the editor, and both files stay where they are.
To delete a file:
- Hover over the file in the tree.
- Click ✕.
- Confirm the deletion.
The message “Deleted” («Удалено») appears.
Code versions
A version is a snapshot of the code of a landing page or offer. The 10 most recent versions are kept: when a new one is saved, the oldest is deleted.
A version is created:
- manually — with the Save current version («Сохранить текущую версию») button;
- automatically — before the code is replaced with an archive;
- automatically — before another version is restored.
Saving a file, uploading files, renaming and deleting do not create versions. Unsaved changes do not get into a version.
To save a version:
- Click Versions.
- In the “Code versions” window, click Save current version.
A row with the date, time and size appears in the list.
To go back to a version:
- Click Versions.
- Click Restore («Восстановить») in the row of the version you need.
- Confirm: “Restore the selected code version? The current code will be saved as a separate version. The lead log will be kept.” («Восстановить выбранную версию кода? Текущий код сохранится отдельной версией. Журнал лидов сохранится.»)
The files are replaced with the files of the selected version. The code that existed before the restore stays in the version list.
ZIP export
Click Export ZIP, and the browser downloads an archive with all the page files. The button is active when there is at least one file.
The export and versions do not include the leads.php lead logs or files and folders whose names start with a dot. The lead log is visible in the file tree only to the owner, the admin and the employee who owns the offer — see Lead log of a hosted offer.
Offer with network PHP
If an offer has PHP with network access («PHP с доступом в сеть») checked, some editor actions are available only to the owner, the admin and the designer:
- creating, saving, uploading and deleting
.phpfiles; - Upload .zip;
- Rename — for any file;
- Save current version and Restore.
In such an offer, the team lead edits, uploads and deletes the other files — HTML, CSS, scripts, images — opens the version list and downloads the code with Export ZIP. About the mode itself — on the PHP in hosted pages and network access page.
Check
- Click Open ↗.
- Make sure the page in the new tab shows the saved changes.
Opening the direct address does not create a click, and click macros are substituted only when the page is opened through a campaign link — see Direct addresses and preview.
Troubleshooting
Only the owner, the admin and the designer can change the PHP code of an offer with internet access («PHP-код оффера с доступом в интернет меняют владелец, администратор и верстальщик»)
The offer has PHP with network access checked, and this action is available only to the owner, the admin and the designer — see Offer with network PHP.
Hidden files (starting with a dot) are not supported («скрытые файлы (начинающиеся с точки) не поддерживаются»)
The path contains a file or folder whose name starts with a dot, for example .htaccess, or you are renaming the lead log. Use a name without a dot. The editor does not open or delete dot files from an archive — see Hidden files.
Invalid path («недопустимый путь»)
The path contains .. or ends with /. Enter a path like css/extra.css.
Too many files («слишком много файлов»)
The page has reached the maximum number of files — see Archive requirements and limits. Delete unnecessary files and try again.