### Install and Start Bootstrap Package with npm Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.4/ResourcePackage/Bootstrap5/README.md This snippet shows the basic npm commands to install the Bootstrap package and start the development server. 'npm start' executes default scripts and watches for file changes. ```npm npm install npm start ``` -------------------------------- ### Install and Start Bootstrap Package with Npm Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap4/README.md Commands to install the Bootstrap package using npm and to start the development server, which watches for file changes. This assumes Node.js and npm are installed. ```shell > npm install > npm start ``` -------------------------------- ### Get Sitefinity CLI Command Help Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Provides access to help documentation for Sitefinity CLI commands. You can get general help or specific help for individual commands and subcommands, including all available options and usage examples. ```bash # General help sf -? sf --help # Command-specific help sf add -? sf create -? sf upgrade -? sf migrate -? # Subcommand help sf add widget -? sf add package -? sf add pagetemplate -? sf migrate page -? # Example: View all options for upgrade command sf upgrade -? # Output shows: # - Required arguments # - Optional flags # - Description of each option # - Usage examples ``` -------------------------------- ### Sample Handlebars Template File Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md A basic example of a template file using Handlebars syntax for dynamic content generation. This file defines placeholders for data that will be populated during the generation process. ```handlebars {{> sign}} {{message}} {{time}} {{age}} ``` -------------------------------- ### Sitefinity CLI Migration Configuration (JSON) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Example configuration for the Sitefinity CLI's migration command, specifying settings for CMS URL, token, and widget migration. This allows for automated migration of content and widgets. ```json { "Commands": { "Migrate": { "CmsUrl": "http://localhost", "Token": "TOKEN", "Recreate": false, "Recursive": false, "Replace": false, "Action": "publish", "SiteId": "00000000-0000-0000-0000-000000000000", "Widgets": { "Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock": { "Name": "SitefinityContentBlock", "Whitelist": ["Html", "ProviderName", "SharedContentID"], "Rename": { "Html": "Content" }, "CleanNullProperties": true } } } } ``` -------------------------------- ### Add Custom Module using Sitefinity CLI Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Generates a complete custom module project, including installer, configuration, and business logic structure. Allows for custom module names and descriptions. ```bash # Create new module sf add module "ProductCatalog" # Create module with description sf add module "Inventory System" --description "Manages product inventory and stock levels" ``` -------------------------------- ### Create MVC Widget Template (Example) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.3/ResourcePackage/Bootstrap5/README.md Demonstrates the file naming convention for creating new MVC widget templates for dynamic content modules. New templates should follow a `List.XXXXXX.cshtml` or `Detail.XXXXXX.cshtml` pattern within a module-specific folder. ```cshtml // Example: For a dynamic content module named 'Products' // Create a folder: /ResourcePackages/Bootstrap5/MVC/Views/Products/ // Create a file: List.FeaturedProducts.cshtml or Detail.ProductOverview.cshtml ``` -------------------------------- ### Create a New Grid Widget Template (HTML) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap4/README.md This example demonstrates how to create a new grid widget template by duplicating an existing one and naming it according to the convention. It specifically shows creating a simple placeholder using a '
' tag. ```html
``` -------------------------------- ### Create Simple Grid Widget Template (HTML) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/13.3/ResourcePackage/Bootstrap4/README.md Illustrates how to create a new, simple grid widget template by duplicating an existing one and naming it appropriately. This example shows creating a template for a section with a `
` tag. ```html // In /ResourcePackages/Bootstrap4/GridSystem/Templates/ section.html
``` -------------------------------- ### Get Sitefinity CLI Version Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Command to display the currently installed version of the Sitefinity CLI tool. This is useful for checking compatibility and ensuring you are using the intended version. ```bash sf version ``` -------------------------------- ### Run Sitefinity CLI Tests Source: https://github.com/sitefinity/sitefinity-cli/blob/master/CONTRIBUTING.md This command executes the test suite for the Sitefinity CLI project. Ensure you have the .NET SDK installed. The tests help validate code changes and ensure the project's stability. No specific input is required, but the output will indicate test results. ```bash dotnet test ``` -------------------------------- ### Build Sitefinity CLI from Source (.NET CLI) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md This command builds the Sitefinity CLI application from its source code for a specific operating system. It requires the .NET SDK to be installed. Replace '[rid]' with the appropriate .NET Core RID catalog identifier for your OS. The output is typically found in a 'publish' subfolder. ```bash dotnet publish -c release -r [rid] ``` ```bash dotnet publish -c release -r win-x64 ``` -------------------------------- ### Create New Grid Widget Template Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.0/ResourcePackage/Bootstrap4/README.md Shows how to create a new grid widget template by duplicating an existing one and naming it appropriately. It also provides an example of creating a simple section element as a grid widget. ```html // Example of modifying an existing grid widget template (grid-6+6.html):
// Example of creating a new simple section grid widget template (section.html):
``` -------------------------------- ### Create/Modify Grid Widget Templates (HTML) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.1/ResourcePackage/Bootstrap4/README.md Illustrates creating and modifying grid widget templates using HTML files. New templates are made by copying existing ones and following naming conventions. An example shows how to add custom CSS classes and change placeholder labels. ```html
``` ```html
``` -------------------------------- ### Create and Edit Grid Widget Templates Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.1/ResourcePackage/Bootstrap5/README.md Explains how to modify and create grid widget templates, which are typically HTML files. It provides an example of modifying a grid with two equal columns and creating a simple section placeholder. ```html
``` ```html // Example for creating a simple placeholder with a
tag: // Create section.html in /ResourcePackages/Bootstrap5/GridSystem/Templates/
``` -------------------------------- ### Check Sitefinity CLI Version Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Command to display the current version of the Sitefinity CLI installed on your system. This is useful for ensuring you are using the latest features and bug fixes. ```bash # Display version information sf version # Output example: # Sitefinity CLI v1.1.0 ``` -------------------------------- ### SCSS File Structure and Importing Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap4/README.md Organize SCSS files in `assets/src/project/sass` with subfolders. Import necessary files into `main.scss`. The `npm start` command processes these files into `assets/dist/css/main.css`. You can customize imports for Sitefinity CMS or Bootstrap CSS. ```SCSS File structure |- sass |-- settings |--- _colors.scss |--- _typography.scss ... |-- base |--- _link.scss |--- _typography.scss ... main.scss //Import Bootstrap from npm @import "../../../../node_modules/bootstrap/scss/bootstrap"; @import "../../../../node_modules/magnific-popup/src/css/main"; // Sitefinity @import "../../sitefinity/sass/sitefinity"; //Import .scss files here ... ``` -------------------------------- ### SVG Sprite Configuration and Usage Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.3/ResourcePackage/Bootstrap5/README.md Explains how to list additional SVG sprites to be copied to the distribution folder in `package.json`. It also provides an example of how to use an SVG icon from a sprite in a widget template. ```JSON ..., "config": { "copySprites": "... assets/src/project/sprites/sprite-1.svg assets/src/project/sprites/sprite-2.svg " } ``` ```HTML ``` -------------------------------- ### SCSS File Structure and Import Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/13.3/ResourcePackage/Bootstrap4/README.md Organize SCSS files into subfolders within `assets/src/project/sass`. Import these files into `main.scss` to be processed by `npm start`. External libraries like Bootstrap can also be imported. ```text |- sass |-- settings |--- _colors.scss |--- _typography.scss ... |-- base |--- _link.scss |--- _typography.scss ... main.scss //Import Bootstrap from npm @import "../../../../node_modules/bootstrap/scss/bootstrap"; @import "../../../../node_modules/magnific-popup/src/css/main"; // Sitefinity @import "../../sitefinity/sass/sitefinity"; //Import .scss files here ... ``` -------------------------------- ### Using SVG Icon in Widget Template Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap5/README.md Provides an example of how to embed an SVG icon using the `` element within a Sitefinity widget template, referencing a sprite file and an icon ID. ```html ``` -------------------------------- ### JavaScript File Copy Configuration Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.3/ResourcePackage/Bootstrap4/README.md Demonstrates how to specify JavaScript files to be copied to the distribution directory (`assets/dist/js`) by listing them in the `config.copyJs` section of `package.json`. It also shows an example of how to reference a copied JavaScript file in a Razor layout. ```json { "config": { "copyJs": "... assets/src/project/js/project-file-1.js assets/src/project/js/project-file-2.js" } } ``` ```cshtml @Html.Script(Url.Content("~/ResourcePackages/Bootstrap4/assets/dist/js/project-file-1.js"), "bottom", true) ``` -------------------------------- ### Javascript File Inclusion in Layout Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.3/ResourcePackage/Bootstrap5/README.md Shows how to specify Javascript files to be copied to the distribution folder in `package.json`. It also provides an example of how to reference a Javascript file in a Razor layout file using `Html.Script`. ```JSON ..., "config": { "copyJs": "... assets/src/project/js/project-file-1.js assets/src/project/js/project-file-2.js" } ``` ```cshtml @Html.Script(Url.Content("~/ResourcePackages/Bootstrap5/assets/dist/js/project-file-1.js"), "bottom", true) ``` -------------------------------- ### SCSS File Organization and Compilation Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.2/ResourcePackage/Bootstrap5/README.md Organize SCSS files into subfolders within `assets/src/project/sass`. Import these files into `main.scss` for processing. The `npm start` command compiles all imported SCSS into `assets/dist/css/main.css`. Sitefinity and Bootstrap imports can be modified in `main.scss`. ```SCSS //Vendoers @import "../../vendors"; //Sitefinity @import "../../sitefinity/sass"; //Import .scss files here ... ``` ```shell File structure |- sass |-- settings |--- _colors.scss |--- _typography.scss ... |-- base |--- _link.scss |--- _typography.scss ... ``` -------------------------------- ### SVG Sprite Copy Configuration and Usage Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.3/ResourcePackage/Bootstrap4/README.md Explains how to configure additional SVG sprites to be copied to the distribution folder (`assets/dist/sprites`) via the `config.copySprites` section in `package.json`. It provides an example of how to use an SVG icon from a sprite in a widget template. ```json { "config": { "copySprites": "... assets/src/project/sprites/sprite-1.svg assets/src/project/sprites/sprite-2.svg " } } ``` ```html ``` -------------------------------- ### SCSS Compilation Configuration in Sitefinity CLI Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.0/ResourcePackage/Bootstrap4/README.md This snippet shows how to organize and import SCSS files for compilation. It details the directory structure for SCSS assets and the `main.scss` file's import rules. When `npm start` is executed, all imported SCSS files are processed and output to `assets/dist/css/main.css`. Users can customize imports to exclude Sitefinity or Bootstrap CSS. ```scss File structure |- sass |-- settings |--- _colors.scss |--- _typography.scss ... |-- base |--- _link.scss |--- _typography.scss ... main.scss //Import Bootstrap from npm @import "../../../../node_modules/bootstrap/scss/bootstrap"; @import "../../../../node_modules/magnific-popup/src/css/main"; // Sitefinity @import "../../sitefinity/sass/sitefinity"; //Import .scss files here ... ``` ```text When you run `npm start`, all SCSS files imported in `assets/src/project/sass/main.scss` are processed and output in `assets/dist/css/main.css` If you do not want to include Sitefinity CMS or Bootstrap CSS, or you want to use another Bootstrap version, change the import rule `@import "../../sitefinity/sass/sitefinity.scss";` or `@import "../../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap.scss";` in `assets/src/project/sass/main.scss`. ``` -------------------------------- ### Create New Sitefinity Project (Sitefinity CLI) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Command to initialize a new Sitefinity project. It can take the project name and an optional directory path. Additional flags like '--headless', '--coreModules', and '--renderer' allow for specific project configurations. ```bash sf create TestProject ``` ```bash sf create TestProject "D:\\TestProjectFolder" ``` ```bash sf create TestProject --headless ``` ```bash sf create TestProject --coreModules ``` ```bash sf create TestProject --renderer ``` -------------------------------- ### Create Sitefinity Project using Sitefinity CLI Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Generates a new Sitefinity CMS project with options for headless CMS, core modules only, ASP.NET Core renderer, specific Sitefinity versions, and custom NuGet sources. ```bash # Create standard Sitefinity project in current directory sf create MyProject # Create project in specific directory sf create MyProject "D:\Projects\MyProjectFolder" # Create headless version of Sitefinity sf create MyProject --headless # Create with core modules only sf create MyProject --coreModules # Create ASP.NET Core renderer project sf create MyRenderer --renderer # Create project with specific Sitefinity version sf create MyProject --version "15.3.8500" # Create with custom NuGet sources sf create MyProject --sources "https://nuget.example.com/feed,https://api.nuget.org/v3/index.json" # Example: Complete project creation with version and custom location sf create ECommercePortal "C:\Development\Sites" --version "15.2.8400" --sources "https://api.nuget.org/v3/index.json" ``` -------------------------------- ### Add Sitefinity Integration Tests Project Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Creates a NUnit test project pre-configured for Sitefinity integration testing. This command sets up a new test project with Sitefinity test utilities and NUnit framework references. ```bash # Create integration tests project sf add tests "MyProject.Tests.Integration" # Create tests with version specification sf add tests "ECommerce.Tests.Integration" --version "15.0" # Example: Add integration tests to existing solution cd C:\Projects\MySiteSolution sf add tests "MySite.Tests.Integration" --version "15.3" # Creates new test project with: # - NUnit framework references # - Sitefinity test utilities # - Sample test class DemoTests.cs ``` -------------------------------- ### Create Sitefinity Module Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Creates a new Sitefinity module for a specified version and description. This command generates the necessary files for a custom module within your Sitefinity project. ```bash # Create module for specific version sf add module "CustomerPortal" --version "15.0" --description "Customer self-service portal" # Example: Complete module creation cd C:\Projects\MySite sf add module "EventManagement" --description "Custom event registration and ticketing system" --version "15.3" # Creates new project: EventManagement/ # - EventManagementInstaller.cs # - EventManagementModule.cs # - Configuration/EventManagementConfig.cs ``` -------------------------------- ### Create New Dynamic Content Widget Template Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.1/ResourcePackage/Bootstrap5/README.md Steps to create widget templates for dynamic content. This involves creating a specific folder structure and naming convention for list and detail views. ```text 1. Create a folder with a name that corresponds to the name of the dynamic content module (in singular). In this folder, you organize the project widget templates, located in either `/Mvc/Views/` or `/ResourcePackages/Bootstrap5/MVC/Views`. 2. Create a `*.cshtml` file, according to the following convention: `List.XXXXXX.cshtml` for list view and `Detail.XXXXXX.cshtml` for details view. 3. Write the markup of the template. ``` -------------------------------- ### Create New MVC Widget Template Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.0/ResourcePackage/Bootstrap4/README.md Demonstrates the file naming convention for creating new MVC widget templates. This applies to both standard widgets and dynamic content widgets, specifying list and detail views. ```html // For standard widgets: // NavigationView.XXXXXX.cshtml // For dynamic content widgets (list view): // List.XXXXXX.cshtml // For dynamic content widgets (detail view): // Detail.XXXXXX.cshtml ``` -------------------------------- ### Responsive Navigation Widget to Dropdown (C#) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.1/ResourcePackage/Bootstrap4/README.md Shows how to make the Navigation widget responsive by converting it into a dropdown using a C# helper method. This involves modifying the Navigation widget template and the Dropdown.cshtml file. ```csharp @Html.Action("GetView", new { viewName = "Dropdown", model = Model }) ``` -------------------------------- ### Create Dynamic Content Widget Templates (HTML/Razor) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/13.3/ResourcePackage/Bootstrap4/README.md Explains how to create widget templates for dynamic content modules. This includes creating a module-specific folder and naming convention for list and detail view templates. ```html // Create a folder matching the dynamic content module name (singular) // e.g., for a 'Books' module, create a 'Book' folder // Inside the folder (e.g., /Mvc/Views/Book/ or /ResourcePackages/Bootstrap4/MVC/Views/Book/) List.XXXXXX.cshtml Detail.XXXXXX.cshtml ``` -------------------------------- ### Implement Navigation Widget as Dropdown (CSHTML) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.3/ResourcePackage/Bootstrap5/README.md Demonstrates how to use a helper method in a Sitefinity navigation widget template to render it as a dropdown select element. This requires modifying the template file and the `Dropdown.cshtml` partial view. ```cshtml // In /ResourcePackages/Bootstrap5/MVC/Views/Navigation/NavigationView.Horizontal.cshtml @Html.Action("GetView", new { viewName = "Dropdown", model = Model }) ``` -------------------------------- ### Migrate Sitefinity Template with CLI Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Command to migrate a Sitefinity template. Requires template ID, CMS URL, and an authentication token. Optional flags allow for recursive migration and recreation of templates. ```bash sf migrate template "7f8e9d0c-1a2b-3c4d-5e6f-7890abcdef12" --cmsUrl "https://mysite.com" --token "your-token" --site "12345678-1234-1234-1234-123456789012" ``` ```bash sf migrate template "7f8e9d0c-1a2b-3c4d-5e6f-7890abcdef12" \ --cmsUrl "https://corporate.example.com" \ --token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ --recursive \ --recreate ``` -------------------------------- ### Responsive Navigation Widget Template (C#) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap4/README.md This C# code snippet demonstrates how to implement responsive design for the Navigation widget by transforming it into a dropdown select element. It utilizes a helper method to render the select and points to the associated .cshtml file for markup customization. ```csharp @Html.Action("GetView", new { viewName = "Dropdown", model= Model}) ``` -------------------------------- ### Create New MVC Widget Template Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.1/ResourcePackage/Bootstrap5/README.md Instructions for creating a new MVC widget template by duplicating an existing one and renaming it according to convention. This ensures the new template appears in the widget designer. ```text 1. Duplicate an existing template. 2. Name the new file according to the following convention: `NavigationView.XXXXXX.cshtml`. NOTE: For widgets that have list and details views, the structure should be `List.XXXXXX.cshtml` or `Detail.XXXXXX.cshtml`, respectively. ``` -------------------------------- ### Add Resource Package using Sitefinity CLI Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Adds a new resource package (theme) to the current Sitefinity project. Supports default configuration, specific templates like Bootstrap4 and Bootstrap5, and version compatibility. ```bash # Add default Bootstrap4 resource package sf add package "Custom Theme" # Add Bootstrap5 resource package (Sitefinity 14.1+) sf add package "Modern Theme" --template Bootstrap5 # Add package with specific Sitefinity version compatibility sf add package "Legacy Theme" --version "13.3" --template Bootstrap4 # Example: Navigate to project root and add resource package cd C:\Projects\MySitefinityApp\SitefinityWebApp sf add package "CorporateTheme" --template Bootstrap5 ``` -------------------------------- ### Navigation Widget Responsive Transformation (C#) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/13.3/ResourcePackage/Bootstrap4/README.md Demonstrates how to transform the Navigation widget into a dropdown select element for responsive design using a C# helper method within a Razor view. ```csharp // In Navigation widget template file (e.g., NavigationView.Horizontal.cshtml) @Html.Action("GetView", new { viewName = "Dropdown", model = Model }) ``` -------------------------------- ### Add Package with Specific Version - Sitefinity CLI Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Demonstrates adding a new resource package using the Sitefinity CLI, specifying a particular Sitefinity CMS version for template generation. This ensures the correct template set is used for the new package. ```bash sf add package "New resource package" --version "11.0" ``` -------------------------------- ### JavaScript File Copy Configuration Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap5/README.md Shows how to configure the `packages.json` file to specify which JavaScript files should be copied to the distribution folder. ```json ..., "config": { "copyJs": "... assets/src/project/js/project-file-1.js assets/src/project/js/project-file-2.js" } ``` -------------------------------- ### Create New Widget Template (MVC) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.3/ResourcePackage/Bootstrap4/README.md Instructions for creating new widget templates in Sitefinity. This involves duplicating an existing template file and renaming it according to specific conventions. For dynamic content widgets, separate conventions apply for list and detail views. -------------------------------- ### Add Custom Widget using Sitefinity CLI Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Creates a new MVC widget, including controller, model, and view files. Allows specifying custom templates and version compatibility. ```bash # Add custom widget with default template sf add widget "ProductCarousel" # Add widget with specific template sf add widget "CustomGallery" --template "Default" # Add widget compatible with specific Sitefinity version sf add widget "NewsSlider" --version "15.0" # Example: Complete widget creation workflow cd C:\Projects\MySite\SitefinityWebApp sf add widget "FeaturedProducts" --template "Default" --version "15.3" # Files created: # - MVC/Controllers/FeaturedProductsController.cs # - MVC/Models/FeaturedProductsModel.cs # - MVC/Views/FeaturedProducts/Index.cshtml ``` -------------------------------- ### JavaScript File Inclusion in Sitefinity Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap4/README.md List JavaScript files to be copied to `assets/dist/js` in the `packages.json -> config.copyJs` section. Reference these files in your Razor layout files using `@Html.Script` for bottom loading. ```JSON "config": { "copyJs": "... assets/src/project/js/project-file-1.js assets/src/project/js/project-file-2.js" } ``` ```C# @Html.Script(Url.Content("~/ResourcePackages/Bootstrap4/assets/dist/js/project-file-1.js"), "bottom", true) ``` -------------------------------- ### Create MVC Widget Template (HTML/Razor) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/13.3/ResourcePackage/Bootstrap4/README.md Demonstrates the file naming convention for creating new MVC widget templates. This involves duplicating an existing template and renaming it according to specific patterns for list, detail, or general views. ```html // For general widget templates NavigationView.XXXXXX.cshtml // For widgets with list and detail views List.XXXXXX.cshtml Detail.XXXXXX.cshtml ``` -------------------------------- ### SVG Sprite Copy Configuration Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap5/README.md Details how to list additional SVG sprite files in `packages.json` to be copied to the distribution folder. ```json ..., "config": { "copySprites": "... assets/src/project/sprites/sprite-1.svg assets/src/project/sprites/sprite-2.svg ", } ``` -------------------------------- ### Add Page Template with Custom Template - Sitefinity CLI Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Illustrates how to add a new page template using the Sitefinity CLI, specifying a custom template file for generation. This allows for pre-defined page structures. ```bash sf add pagetemplate "New page" --template "CustomPageTemplate" ``` -------------------------------- ### Add Grid Widget using Sitefinity CLI Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Creates a custom grid widget for defining page layout structures within resource packages. Supports default templates and version specification. ```bash # Add grid widget with default template sf add gridwidget "CustomGrid" # Add grid widget to specific version sf add gridwidget "ResponsiveGrid" --version "14.0" # Example: Create grid widget for Bootstrap 5 theme cd C:\Projects\MySite\SitefinityWebApp sf add gridwidget "FlexboxGrid" --version "15.0" # Creates: ResourcePackages/[PackageName]/GridSystem/Templates/FlexboxGrid.html ``` -------------------------------- ### Sitefinity CLI Widget Migration Configuration (JSON) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Configuration snippet for migrating specific Sitefinity widgets, detailing how to map properties, rename them, and handle null values. This is part of the appsettings.json configuration for the CLI. ```json { "Commands": { "Migrate": { ... "Widgets": { "Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock": { // the name of the new widget in NetCore/NextJs renderers "Name": "SitefinityContentBlock", // the whitelist of properties to keep during the migration "Whitelist": ["Html", "ProviderName", "SharedContentID"], "Rename": { // the properties to be renamed "Html": "Content" }, "CleanNullProperties": true } } } } } ``` -------------------------------- ### Create/Modify MVC Widget Templates (CSHTML) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.1/ResourcePackage/Bootstrap4/README.md Demonstrates how to create and modify MVC widget templates using .cshtml files. New templates are created by duplicating existing ones and following naming conventions. For dynamic content, templates are organized in folders named after the module. ```html <%@ Control Language="C#" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewUserControl" %> <%@ Register TagPrefix="sf" Namespace="Sitefinity.Frontend.Mvc.Widgets.Navigation" Assembly="Sitefinity.Frontend.Mvc" %> ``` -------------------------------- ### Custom Template Configuration JSON Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md A sample JSON configuration file used with custom Handlebars templates. This file lists the properties expected by the template, which the CLI will prompt the user for. ```json [ "message", "time", "age" ] ``` -------------------------------- ### Create and Modify MVC Widget Templates Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.1/ResourcePackage/Bootstrap5/README.md Demonstrates the process of creating and modifying MVC widget templates by duplicating and renaming existing .cshtml files. It specifies naming conventions for standard and dynamic content views. ```cshtml // Example for modifying an existing Countries navigation template: // Navigate to /ResourcePackages/Bootstrap5/MVC/Views/Navigation // Open NavigationView.Countries.cshtml and make changes. // Example for creating a new navigation template: // Duplicate an existing template. // Name the new file according to the convention: NavigationView.XXXXXX.cshtml // Example for list and details views for dynamic content: // Create a folder named after the dynamic content module (singular). // Create *.cshtml files with conventions: List.XXXXXX.cshtml or Detail.XXXXXX.cshtml ``` -------------------------------- ### SCSS Compilation Configuration Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.1/ResourcePackage/Bootstrap5/README.md Organize SCSS files in `assets/src/project/sass` and import them in `main.scss`. The CLI compiles these into `assets/dist/css/main.css`. You can customize Sitefinity or Bootstrap imports. ```SCSS File structure |- sass |-- settings |--- _colors.scss |--- _typography.scss ... |-- base |--- _link.scss |--- _typography.scss ... main.scss //Vendoers @import "../../vendors"; //Sitefinity @import "../../sitefinity/sass"; //Import .scss files here ... ``` ```SCSS // To exclude Sitefinity or Bootstrap CSS, modify these imports in main.scss: // @import "../../sitefinity/sass/sitefinity.scss"; // @import "../../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap.scss"; ``` -------------------------------- ### JavaScript File Copy Configuration and Usage Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.2/ResourcePackage/Bootstrap5/README.md List JavaScript files to be copied to the distribution folder in the `config.copyJs` section of `package.json`. These files can then be referenced in Razor layout files using `Html.Script`. ```json "config": { "copyJs": "... assets/src/project/js/project-file-1.js assets/src/project/js/project-file-2.js" } ``` ```cshtml @Html.Script(Url.Content("~/ResourcePackages/Bootstrap5/assets/dist/js/project-file-1.js"), "bottom", true) ``` -------------------------------- ### Upgrade Sitefinity Project Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Upgrades an existing Sitefinity project to a newer version. This command handles automatic dependency resolution, NuGet package updates, and optionally removes deprecated packages. ```bash # Upgrade to specific version sf upgrade "C:\Projects\MySite\SitefinityWebApp.sln" "15.3.8500" # Upgrade to latest version (auto-detected) sf upgrade "C:\Projects\MySite\SitefinityWebApp.sln" # Skip all prompts and accept license automatically sf upgrade "C:\Projects\MySite\SitefinityWebApp.sln" "15.3.8500" --skipPrompts --acceptLicense # Remove deprecated packages during upgrade sf upgrade "C:\Projects\MySite\SitefinityWebApp.sln" "15.3.8500" --removeDeprecatedPackages # Remove deprecated packages except specific ones sf upgrade "C:\Projects\MySite\SitefinityWebApp.sln" "15.3.8500" --removeDeprecatedPackagesExcept "Telerik.DataAccess.Fluent;CsvHelper" # Upgrade with additional custom packages sf upgrade "C:\Projects\MySite\SitefinityWebApp.sln" "15.3.8500" --additionalPackages "CustomPackage1,CustomPackage2" # Upgrade with custom NuGet config sf upgrade "C:\Projects\MySite\SitefinityWebApp.sln" "15.3.8500" --nugetConfigPath "C:\Config\Custom.NuGet.Config" # Example: Production upgrade workflow sf upgrade "C:\Production\MySite\SitefinityWebApp.sln" "15.3.8500" --removeDeprecatedPackages --acceptLicense --additionalPackages "Telerik.Sitefinity.Ecommerce" --nugetConfigPath "C:\Config\nuget.config" # Steps performed: # 1. Detects current Sitefinity version # 2. Validates upgrade path # 3. Collects dependency tree # 4. Removes deprecated packages # 5. Updates all Sitefinity NuGet packages # 6. Syncs project references # 7. Updates configuration files ``` -------------------------------- ### Advanced Sitefinity Migration Configuration Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt JSON configuration file for advanced migration settings, including custom widget mappings and migration behavior. This allows for detailed control over how widgets are migrated, including whitelisting properties, renaming them, and cleaning null properties. ```json { "Commands": { "Migrate": { "CmsUrl": "https://mysite.example.com", "Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "Recreate": false, "Recursive": false, "Replace": false, "Action": "publish", "SiteId": "00000000-0000-0000-0000-000000000000", "Widgets": { "Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock": { "Name": "SitefinityContentBlock", "Whitelist": ["Html", "ProviderName", "SharedContentID"], "Rename": { "Html": "Content" }, "CleanNullProperties": true }, "Telerik.Sitefinity.Widgets.LoginWidget": { "Name": "SitefinityLogin", "Whitelist": ["LoginFormTemplateId", "RedirectUrl"], "Rename": { "LoginFormTemplateId": "TemplateId" }, "CleanNullProperties": true }, "CustomNamespace.CustomWidget": { "Name": "CustomNetCoreWidget", "Whitelist": ["Title", "Content", "EnableCache"], "Rename": { "Title": "Heading", "EnableCache": "CacheEnabled" }, "CleanNullProperties": true } } } } } ``` -------------------------------- ### Add Integration Tests Project (Sitefinity CLI) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Command to scaffold a new integration testing project for a Sitefinity solution. This is crucial for ensuring the stability and correctness of custom development. The command takes the resource type ('tests') and the project name. ```bash sf add tests "Sitefinity.Tests.Integration" ``` -------------------------------- ### Create New MVC Widget Template Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap5/README.md To create a new MVC widget template, duplicate an existing one and rename it following the convention `NavigationView.XXXXXX.cshtml`. For list and detail views, use `List.XXXXXX.cshtml` or `Detail.XXXXXX.cshtml`. Ensure the new template is placed in the correct resource package directory. ```text NavigationView.XXXXXX.cshtml List.XXXXXX.cshtml Detail.XXXXXX.cshtml ``` -------------------------------- ### Migrate Sitefinity Page to ASP.NET Core Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Migrates individual Sitefinity pages from Web Forms/MVC to the ASP.NET Core renderer architecture. This command can migrate single pages, recursively migrate child pages, and optionally replace the original page. ```bash # Migrate single page by ID sf migrate page "3d2a5c7e-9f4b-4a1c-8e6d-1234567890ab" --cmsUrl "https://mysite.com" --token "your-access-token" # Migrate page and replace original (creates draft) sf migrate page "3d2a5c7e-9f4b-4a1c-8e6d-1234567890ab" --cmsUrl "https://mysite.com" --token "your-token" --replace # Migrate page recursively with all child pages sf migrate page "3d2a5c7e-9f4b-4a1c-8e6d-1234567890ab" --cmsUrl "https://mysite.com" --token "your-token" --recursive # Recreate page if already migrated (for testing) sf migrate page "3d2a5c7e-9f4b-4a1c-8e6d-1234567890ab" --cmsUrl "https://mysite.com" --token "your-token" --recreate # Migrate page for specific site sf migrate page "3d2a5c7e-9f4b-4a1c-8e6d-1234567890ab" --cmsUrl "https://mysite.com" --token "your-token" --site "12345678-1234-1234-1234-123456789012" # Example: Complete page migration workflow sf migrate page "a1b2c3d4-e5f6-7890-abcd-ef1234567890" \ --cmsUrl "https://www.example.com" \ --token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ --recursive \ --replace # Result: # - Original page preserved # - Duplicate created with suffix "(migrated to Decoupled)" # - All child pages migrated recursively # - Widgets automatically converted to ASP.NET Core equivalents # - Forms automatically migrated if present ``` -------------------------------- ### Add Page Template using Sitefinity CLI Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Adds a new Razor page template to a resource package for custom page layouts. Supports default configuration, specific resource packages, and version specification. ```bash # Add page template with default configuration sf add pagetemplate "TwoColumnLayout" # Add page template to specific resource package sf add pagetemplate "ThreeColumnLayout" --template "Test" # Add template with version specification sf add pagetemplate "LandingPage" --version "15.0" # Example: Add template to existing resource package cd C:\Projects\MySite\SitefinityWebApp sf add pagetemplate "ProductDetailPage" --template "Test" # Creates: ResourcePackages/[PackageName]/MVC/Views/Layouts/ProductDetailPage.cshtml ``` -------------------------------- ### Navigation Widget to Dropdown Transformation Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.1/ResourcePackage/Bootstrap5/README.md Illustrates how to transform the Navigation widget into a select dropdown using a C# helper method within the .cshtml template. It requires modifying both the main navigation template and the Dropdown.cshtml partial view. ```cshtml // In the Navigation widget template file (e.g., NavigationView.Horizontal.cshtml): @Html.Action("GetView", new { viewName = "Dropdown", model= Model}) // Modify markup in the Dropdown.cshtml file for the select element. ``` -------------------------------- ### JavaScript File Configuration Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/13.3/ResourcePackage/Bootstrap4/README.md Specify JavaScript files to be copied to the distribution folder by listing them in the `config.copyJs` section of `package.json`. These files can then be referenced in Razor layout files. ```json { ..., "config": { "copyJs": "... assets/src/project/js/project-file-1.js assets/src/project/js/project-file-2.js" } } ``` -------------------------------- ### SVG Sprite Configuration in package.json Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.3/ResourcePackage/Bootstrap5/README.md Illustrates how to specify SVG sprite files in the `package.json`'s `config.copySprites` section for the Sitefinity CLI to copy to the distribution folder. ```json ..., "config": { "copySprites": "... assets/src/project/sprites/sprite-1.svg assets/src/project/sprites/sprite-2.svg " } ``` -------------------------------- ### Upgrade Sitefinity Project (Sitefinity CLI) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Command to upgrade an existing Sitefinity project to a specified version. It requires the path to the solution file and the target version. The '--removeDeprecatedPackages' flag can be added to clean up obsolete packages during the upgrade. ```bash sf upgrade "(path-to-your-project)\\SitefinityWebApp.sln" "15.3.8500" ``` ```bash sf upgrade "(path-to-your-project)\\SitefinityWebApp.sln" "15.3.8500" --removeDeprecatedPackages ``` -------------------------------- ### Migrate Sitefinity Page Template to ASP.NET Core Source: https://context7.com/sitefinity/sitefinity-cli/llms.txt Migrates Sitefinity page templates from Web Forms/MVC to the ASP.NET Core renderer architecture. This command supports migrating single templates, recursively migrating child templates, and recreating templates for testing purposes. ```bash # Migrate single template by ID sf migrate template "7f8e9d0c-1a2b-3c4d-5e6f-7890abcdef12" --cmsUrl "https://mysite.com" --token "your-access-token" # Migrate template with all child templates sf migrate template "7f8e9d0c-1a2b-3c4d-5e6f-7890abcdef12" --cmsUrl "https://mysite.com" --token "your-token" --recursive # Recreate template for testing custom widget migrations sf migrate template "7f8e9d0c-1a2b-3c4d-5e6f-7890abcdef12" --cmsUrl "https://mysite.com" --token "your-token" --recreate ``` -------------------------------- ### SVG Sprite Configuration Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/13.3/ResourcePackage/Bootstrap4/README.md List additional SVG sprite files to be copied to the distribution folder in the `config.copySprites` section of `package.json`. These sprites can then be used to reference icons within widget templates. ```json { ..., "config": { "copySprites": "... assets/src/project/sprites/sprite-1.svg assets/src/project/sprites/sprite-2.svg ", } } ``` -------------------------------- ### Add Grid Widget (Sitefinity CLI) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Command to create a new grid widget for use in Sitefinity pages. Grid widgets are fundamental UI components for organizing content layouts. The command requires the resource type ('gridwidget') and a name for the widget. ```bash sf add gridwidget "Test grid" ``` -------------------------------- ### Migrate Page (Sitefinity CLI) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Command used to migrate a specific Sitefinity page to a decoupled renderer architecture (e.g., ASP.NET Core). It requires the unique identifier of the page to be migrated. ```bash sf migrate page "PageId" ``` -------------------------------- ### Add Resource Package (Sitefinity CLI) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Command to create a new resource package within a Sitefinity project. This involves specifying the type of resource ('package') and a name for it. It's a core command for extending project functionality with custom assets. ```bash sf add package "Test resource package" ``` -------------------------------- ### Migrate Page Template (Sitefinity CLI) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Command to migrate a Sitefinity page template to a decoupled architecture. This command is essential for modernizing front-end solutions. It requires the template's unique identifier. ```bash sf migrate template "TemplateId" ``` -------------------------------- ### SVG Sprite Configuration and Usage in Sitefinity Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.2/ResourcePackage/Bootstrap4/README.md Configure additional SVG sprites to be copied to `assets/dist/sprites` by listing them in `package.json -> config.copySprites`. Use SVG sprites in widget templates with the `` tag, referencing the sprite file and icon ID. ```JSON "config": { "copySprites": "... assets/src/project/sprites/sprite-1.svg assets/src/project/sprites/sprite-2.svg " } ``` ```HTML ``` -------------------------------- ### Create New Widget Template Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/14.0/ResourcePackage/Bootstrap4/README.md To create a new widget template, duplicate an existing one and rename it following the convention `NavigationView.XXXXXX.cshtml`. For list and detail views of widgets with dynamic content, use `List.XXXXXX.cshtml` or `Detail.XXXXXX.cshtml` respectively. New templates are automatically displayed in the widget designer. ```razor // Example: Duplicating and renaming NavigationView.Countries.cshtml // New file name: NavigationView.CustomCountries.cshtml ``` -------------------------------- ### Migrate Page with Replace Option - Sitefinity CLI Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Shows how to use the Sitefinity CLI's migrate command for pages, including the --replace option. This option is used after a page has been successfully migrated and its duplicate is no longer needed. ```bash sf migrate page --replace ``` -------------------------------- ### Add Page Template (Sitefinity CLI) Source: https://github.com/sitefinity/sitefinity-cli/blob/master/README.md Command to generate a new page template for a Sitefinity project. This allows developers to define reusable page structures. The command takes the resource type ('pagetemplate') and the desired name as arguments. ```bash sf add pagetemplate "Test page" ``` -------------------------------- ### Responsive Navigation Widget Template Transformation Source: https://github.com/sitefinity/sitefinity-cli/blob/master/Sitefinity CLI/Templates/15.0/ResourcePackage/Bootstrap4/README.md Illustrates how to transform the Navigation widget into a dropdown (select) element for responsive design purposes. This involves using a specific Razor helper method and modifying the corresponding dropdown template. ```csharp // In the Navigation widget template file (e.g., NavigationView.Horizontal.cshtml): @Html.Action("GetView", new { viewName = "Dropdown", model = Model }) // Modify markup in the Dropdown.cshtml file to style the select element. ```