You can use FTP to upload site assets and page overrides to an MDriven Turnkey site when working in the Turnkey administration in LicenseAndTicket is less practical.
MDriven Turnkey provides administration for site assets and page overrides in LicenseAndTicket. FTP gives you direct access to the same site areas, which is useful when you need to upload or update several files.
Before you start
You need access to the Turnkey site in LicenseAndTicket and an FTP client. This guide uses FileZilla as an example, but you can use another FTP client.
Do not use this procedure to install or deploy MDriven Turnkey itself. For a self-hosted installation, follow HowTos:Install MDriven Server and Turnkey on Microsoft Azure or Documentation:Deploying MDriven Server & Turnkey Core on IIS.
Get the FTP connection details
Get the connection details from the publishing profile for the Turnkey site.
- Open the
ManageOneTurnkeySitedialog in LicenseAndTicket. - Download the site's publishing profile.
- Open the downloaded XML file in a text editor.
- Find the FTP section.
- Record the values of
publishUrl,userName, anduserPWD.
| Profile value | Use in your FTP client |
|---|---|
publishUrl
|
The FTP server address. |
userName
|
The FTP user name. |
userPWD
|
The FTP password. |
The publishing profile contains connection credentials. Store it where only authorized people can access it.
Connect with an FTP client
- Start your FTP client. For example, open FileZilla.
- Create a connection to the server specified by
publishUrl. - Enter the
userNameanduserPWDfrom the publishing profile. - Connect and open the site's folders.
- Upload files only to the folder that matches their purpose, as described below.
For example, upload a stylesheet used by your Turnkey site to Content, not to EXT_OverridePages.
Site folders
| Folder | Purpose | Example |
|---|---|---|
Content
|
Stores site assets, including CSS, script files, images, and other content files. | Upload a CSS file or an image used by a page in the Turnkey site. |
EXT_OverridePages
|
Stores .cshtml markup files that replace an automatically generated UI for a ViewModel. An override is matched by file name.
|
Upload the .cshtml file whose name matches the UI that you want to replace.
|
EXT_LateBoundAssembly
|
Stores .NET assemblies for advanced external code that implements IExternalLateBoundService.
|
Upload an assembly when the Turnkey model must call your own .NET method implementation through the late-bound service contract. |
Upload site assets
Use Content for files that support the appearance or client-side behavior of the site.
- In the FTP client, open
Content. - Locate the asset on your computer.
- Upload the file.
- Verify that the relevant page can use the updated asset.
Examples of assets are CSS files, script files, and images.
Upload a page override
A page override is a .cshtml file that replaces a ViewModel's automatically generated UI. The matching is based on the file name, so the override file must use the expected matching name.
- Prepare the
.cshtmlmarkup file. - Confirm that its file name matches the generated UI you intend to replace.
- In the FTP client, open
EXT_OverridePages. - Upload the
.cshtmlfile. - Open the corresponding ViewModel UI and verify that the override is applied.
If the file name does not match, Turnkey cannot use that file as the override for the intended generated UI.
Upload a late-bound assembly (advanced)
Use EXT_LateBoundAssembly only when you need a Turnkey model to call your own .NET code through the IExternalLateBoundService interface.
- Build the .NET assembly that implements
Eco.Services.IExternalLateBoundService. - In the FTP client, open
EXT_LateBoundAssembly. - Upload the assembly.
- Test the model behavior that calls the external implementation.
The interface contract is:
// Eco.Interfaces.dll
namespace Eco.Services
{
//
// Summary:
// Allows you to supply domain object method implementations with late bound assembly
public interface IExternalLateBoundService
{
IElement Execute(IClassifier classifier, IObject theobject, IMethod method,
IModifiableVariableList variableList);
}
}
This extension point is for domain object method implementations supplied by a late-bound assembly. Keep the assembly implementation aligned with the interface contract.
Choose the right way to manage files
| Need | Use |
|---|---|
| Add or update CSS, scripts, images, or other site files through a file client | FTP and Content
|
| Replace automatically generated markup for a ViewModel | FTP and EXT_OverridePages
|
| Provide external .NET implementations for domain object methods | FTP and EXT_LateBoundAssembly
|
| Manage page overrides or site assets through the administration interface | Turnkey administration in LicenseAndTicket |
