Front end - ysolution-it/sitecore-wiki GitHub Wiki
Sitecore Installation Guide
This guide provides step-by-step instructions for installing and configuring essential Sitecore packages, setting up a headless site, and integrating Angular JSS.
1. Install Sitecore Packages
1.1 Install Sitecore Headless Rendering
Purpose: Enables headless architecture, allowing modern frontend frameworks (e.g., React, Angular) to leverage Sitecore's backend.
Steps:
- Visit the official Sitecore download page.
- Download the package suitable for your Sitecore version.
- Follow the installation instructions provided in the documentation.
1.2 Install Sitecore Experience Accelerator (SXA)
Purpose: Simplifies website creation with pre-built components, layouts, and templates.
Steps:
- Navigate to the [Sitecore SXA download page](https://dev.sitecore.net/Downloads/Sitecore_Experience_Accelerator).
- Download the appropriate version.
- Install the package following the documentation.
1.3 Install Sitecore PowerShell Extensions (SPE)
Purpose: Enhances Sitecore administration by enabling automation through scripting.
Steps:
- Download from the [Sitecore Developer Portal](https://dev.sitecore.net/Downloads/Sitecore_PowerShell_Extensions).
- Follow the installation steps outlined in the official documentation.
2. Installing Packages in Sitecore
Steps:
- Access the Sitecore Desktop:
- Log in as an administrator.
- Navigate to the Sitecore Desktop interface.
- Open the Installation Wizard:
- Click the Start button → Development Tools → Installation Wizard.
- Install the Packages:
- Upload each downloaded package.
- Follow on-screen instructions to complete the installation.
3. Setting Up a Headless Site
3.1 Create a Headless Site Collection
- Open Content Editor.
- Navigate to the desired parent location.
- Right-click → Insert → Headless Site Collection.
- Name the collection and click OK.
3.2 Create a Headless Site
- Right-click on the site collection.
- Select Insert → Headless Site.
- Name the project (e.g.,
MyHeadlessSite
).
4. Generating an API Key for API Access
Steps:
- Navigate to System → Settings → Services → API Key.
- Right-click → Insert → API Key.
- Configure:
- Allowed Controllers:
*
(all controllers) - CORS Settings:
*
(all origins)
- Allowed Controllers:
- Save and retrieve the API key for use.
5. Connecting Angular JSS to Sitecore Headless
Prerequisites:
Ensure the following are installed:
- [Node.js](https://nodejs.org/)
- [Git](https://git-scm.com/)
- A fully installed Sitecore Headless instance
5.1 Install Sitecore CLI
npm install -g @sitecore-jss/sitecore-jss-cli
5.2 Create an Angular JSS Application
npx create-sitecore-jss angular
Follow the prompts to configure the app.
5.3 Connect the Angular JSS App to Sitecore
jss setup
Provide:
- Sitecore hostname (e.g.,
devcm.dev.local
) - API key (from Sitecore System settings)
5.4 Update Configuration Files
- Update Sitecore Configuration:
- Modify
sitecoredemo.config
(Line 40) to set hostname, rootPath, and database.
- Modify
- Update Sitecore Path:
- Copy and paste the correct path in the configuration file (Lines 59-60).
5.5 Deploy Configuration to Sitecore
jss deploy config
If deployment fails, manually copy configuration files to:
C:\inetpub\wwwroot\devcm.dev.local\App_Config\Include\zzz
5.6 Start Connected Mode
jss start:connected
This enables real-time data fetching from Sitecore.
6. Verifying the Connection Between Angular JSS and Sitecore
6.1 Inspect Network Activity
- Open the app (
http://localhost:3000
). - Open Developer Tools → Network tab.
- Look for:
- Dictionary Service (translations)
- Layout Service (page structure)
6.2 Test the Layout Service in Postman
- Get the Layout Service API URL from the network tab.
- Test in Postman:
- Method: GET
- Headers:
sc_apikey: <your-api-key>
7. Creating Templates, Pages, and JSON Rendering
7.1 Create a Template
- Navigate to Templates.
- Right-click on Feature → Insert → Template.
- Define Sections and Fields.
7.2 Add a Page from the Template
- Right-click on Home → Insert from Template.
- Populate fields with data.
7.3 Create JSON Rendering
- Go to Layout → Renderings → Feature.
- Right-click → Insert → JSON Rendering.
- Set Content Resolver.
7.4 Add Rendering to a Page
- Navigate to Home Page → Presentation → Details.
- Click Edit → Add rendering.
- Assign the Placeholder (
headless-main
).
8. Creating and Connecting Angular JSS Components
8.1 Create a Component in Angular JSS
jss scaffold HeroBanner
Ensure component name matches Sitecore rendering.
8.2 Map Template Fields in Component HTML
<p>{{ rendering?.fields?.ElegantDesign?.value }}</p>
<img [src]="rendering?.fields?.Logo?.value?.src" alt="{{ rendering?.fields?.Logo?.value?.alt }}" />
8.3 Deploy Configuration
jss deploy config
9. Installing Sitecore XP/XM
Download from the [Sitecore Experience Platform](https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform). Install using the Installation Assistant for XP Single.
10. Additional Notes
- Ensure Proper Permissions: API key must have the necessary permissions.
- CORS Configuration: Update Sitecore settings for non-local environments.
- Testing: Use Postman to verify API connectivity.
This document provides a streamlined and structured approach to setting up Sitecore and integrating it with Angular JSS efficiently.