Home » Documentation » Tools » Using the template FTP server tool
The HTML used to render the public site of Scensum is stored in the database as templates. The Scensum back office allows an administrator to manage these templates directly from the administrative interface.
While this offers the conveniance of instant update and one user interface for all Scensum actions, developers and designers might want to leverage the template design using their favorite HTML editor with support for color coding, intellisense etc.
To support this need, Scensum 2.1 has an FTP server tool that an FTP enabled software can attach to. The templates in the database will then be exposed as HTML files and can be edited using a text or HTML editor.
Console application or windows service
You can either run the FTP server as a windows service or start it manually as a console application. The windows service is normally used in a test or production environment, while the exe-file is to facilitate for developers who want an easy way to start and close the server, and monitor the communication between the FTP client and server.
Configure the FTP server
Locate the Tools folder in your Scensum directory. Open the Litium.Scensum.FtpServer.Console folder (or Litium.Scensum.FtpService.Service if you're configuring the windows service) and open the Litium.Scensum.FtpServer.Console.exe.config file.
IoCConfigPath
The path to the IoC file used when instanciating the template objects.
SettingXmlFilePathTemplate
The path to the settings folder, used among others to read the database connection string. If you change the relative location between the FTP server and the Settings files/folder you'll have to update this path.
MediaDirectoryPath
The path to the media folder is used to display the css and js-files to manage css attributes and javascripts from the FTP server interface.
Port
Incoming FTP port.
PassivePortRangeStart, PassivePortRangeEnd
The outgoing port range used when running the FTP server in passive mode.
Start the console FTP server
Start the console application by double clicking the Litium.Scensum.FtpServer.Console.exe file.
A console window should appear with the message FTP Server starting on port 21. The server is now ready to receive FTP calls.

Start the windows service FTP server
Open a Visual Studio command prompt and navigate to the Litium.Scensum.FtpService.Service folder.
Using the installutil command you can install a windows service:
installutil Litium.Scensum.FtpServer.Service.exe
..or uninstall:
installutil /u Litium.Scensum.FtpServer.Service.exe
Once installed the service can be started from the Control panel \ Administratorve tools \ Services window. The FTP service is installed as Litium.Scensum.FtpServer.Service. Locate the service in the list, right click and select Start.
Connect to the FTP server
You can connect to the FTP server from any application that supports FTP connections. Some HTML editors have the possibility to connect to an external FTP repository directly like Adobe Dreamweawer. If your preferred HTMl editor isn't FTP enabled that you might have to use a stand alone FTP client to first download the file before it can be edited. In this example we'll use the free Notepad++ software which supports file editing via FTP.
Download and install the Notepad++ application. When installed, start the application and locate the FTP folders by selecting the menu option Plugins / FTPSyncronize / Show FTP folders. Checking this option should display a tool window where you can connect to an FTP server.
Click the settings icon to display the settings window.

Click the New button to create a profile and give the profile a name, e.g. "Scensum2".
Enter the address to your FTP server. If you have launched the FTP server console on your local machine, 127.0.0.1 will do just fine. Enter port 21, select Active mode and Binary transfer.
The user credentials are the credentials used by the FTP server to access the Scensum database so you should enter a username and password for a user that has access to the template domain in the Scensum back office.

Best practise!
It's recommended to create a user on the target Scensum installation dedicated to the FTP server with restricted access to only the template domain to avoid accidental changes in access scope.
Save and close by clicking Ok.
Click the connect icon in the FTP folders tool window and select the created profile.
Connecting to the FTP server displays a tree hierarchy where folders for the includes, media archive and templates can be navigated.
Managing templates from the FTP server
Editing existing templates from the FTP interface is as easy as navigating to the tempalate in question, opening the file, changing the content and saving the file back to the server. The template hierarchy displayed is the same as in back office, making it easy to locate the correct template.
Double clicking a template file opens the file for edit in the main window. Each template fragment is encapsulated by a start and an end tag.
As Scensum supports A/B-split testing, all fragment values have a separating A and B tag. If the fragmant should not have a B content, that field can just be left blank.
Note! The fragment and A/B split tags must not be removed or changed.
For each template there's a text file called _Documentation.txt. This file contains all the variables, conditions and functions available for the template grouped by template fragment.
Note! There's currently no support for adding, removing or renaming templates directly from the FTP server interface. These operations must be performed from the back office interface. Changes are displayed in the FTP client by refreshing the template tree.