Saber.Vendor
1.0.3
dotnet add package Saber.Vendor --version 1.0.3
NuGet\Install-Package Saber.Vendor -Version 1.0.3
<PackageReference Include="Saber.Vendor" Version="1.0.3" />
paket add Saber.Vendor --version 1.0.3
#r "nuget: Saber.Vendor, 1.0.3"
// Install Saber.Vendor as a Cake Addin
#addin nuget:?package=Saber.Vendor&version=1.0.3
// Install Saber.Vendor as a Cake Tool
#tool nuget:?package=Saber.Vendor&version=1.0.3
Saber Vendor
Build vendor plugins for Saber
Instructions
- Create a new ASP.NET Core Class Library project
- Include the Nuget Package
Saber.Vendor
in your project - Build & test your vendor plugin:
- Move your vendor project into the
App/Vendors
folder within Saber's Visual Studio project - Run Saber in debug mode
- Move your vendor project into the
Installed vendor plugins can be found by navigating to File > App Settings within the Saber Editor. Some vendor plugins may not be visible from the App Settings tab and would be considered "pass-through", meaning that the plugin "just works".
Vendor plugins cannot be disabled through the Saber Editor and so you must physically remove the vendor files from the project to disable their functionality.
Vendor-Specific Functionality
IVendorStartup
Interface used to execute vendor-specific code when the Saber application starts up. All Vendor classes that inherit IVendorStartup
will be evaluated via
Saber's ConfigureServices
method and Configure
method located in the /App/Startup.cs
class.
IVendorViewRenderer
Interface used to execute vendor-specific code when Saber renders a View. Attribute [ViewPath("/Views/Path/To/myfile.html")]
is required on the class that inherits IVendorViewRenderer
, which will determine when the Render
method is being called to load the associated html
file. Use this interface to add HTML to a View that contains the {{vendor}}
element.
namespace Saber.Vendor.MyPlugin
{
[ViewPath("/Views/AppSettings/appsettings.html")]
public class MyPlugin : IVendorViewRenderer
{
public void Render(Core.IRequest request, View view)
{
var myview = new View("/Vendor/MyPlugin/settings.html");
view["vendor"] += myview.Render();
}
}
}
In the example above, we append the rendered HTML of our settings.html
view to the vendor
element whenever Saber renders the /Views/AppSettings/appsettings.html
View.
NOTE: It is important that you append the rendered HTML to the contents of the
vendor
element instead of replacing the contents because other vendors might have appended content to the same element beforehand.
Saber supports the IVendorViewRenderer
for all views within the application, and the following views include a {{vendor}}
HTML variable so that vendors can extend the Editor UI.
/Views/AppSettings/appsettings.html
, used to add vendor-speicific Application Settings to Saber/Views/PageSettings/pagesettings.html
, used to add vendor-speicific Page Settings to Saber
IVendorController
Interface used to route page requests to vendor-specific controllers. Your class must inherit Controller
as well as IVendorController
in order to work properly.
NOTE: Make sure your controller names do not conflict with potential web pages that users will want to create for their website, such as:
About
,Contact
,Blog
,Wiki
,Projects
,Team
,Terms
,PrivacyPolicy
,Members
,Landing
,Store
,History
, etc.
Currently supported plugins
CORS
Adds CORS-related headers to the controller or service response for trusted cross-origin domains.
Import Export
A vendor plugin for Saber that allows webmasters to backup & restore all web content for their Saber website using a simple zip file. This is useful for creating nightly backups and can also be used to publish pending changes from your local workstation to your live website.
Page List
Display a list of webpages associated with your website, such as blog posts or wiki pages.
Reset Cache
A vendor plugin for Saber that allows webmasters to manually reset the stored cache of objects across all networked servers and executes gulp tasks to copy modified resources to wwwroot. This could be useful if your website isn't loading correctly.
Replace Template
A vendor plugin for Saber that allows webmasters to replace the template website that is included with Saber with the currently published website. This was meant to be an internal tool used by Saber developers to update the official template website that is loaded when the user first runs a new copy of Saber in Visual Studio.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Datasilk.Core.Mvc (>= 1.0.4.2)
- Saber.Core (>= 1.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|
Updated to Saber.Core to include more functionality for vendor plugins