Thursday, September 27, 2018

9 new things in Sitecore 9

Hi, we are going to see about the new thins in sitecore

The 9 things are 
           1. Server role configuration 
             2. Dynamic placeholders
             3. Controlling configuration load order
             4. Sitecore forms 
             5. Switching search providers 
             6. SIF(Sitecore Installation Framework) everywhere
             7. Using set in configuration files
             8. Connecting to sitecore rocks
             9.Infrastructure/software changes

Let's see,

1. Server role configuration

  • Sitecore 9 now allows you to specify (and configure) your servers(roles) easily without any    Patches.
  • In order to Configure a server Simply Update 

               <AppSettings>
   <add key="role:define" value="[server role]"/>
   </AppSettings>

Server Roles:
   Content delivery
       Content Management
       Processing
       Reporting
       Standalone

By default,the instance is configured as Standalone(for Local Development),Meaning it will Perform all the roles.

You can also combine server roles

<AppSettings>
<add key="role:define" value="ContentManagement, Processing,                                                                         Reporting"/>
</AppSettings>

2. Dynamic placeholders

Why use Dynamic Placeholders?

  • Very simply, placeholders within a page must be unique. you can only have a single placeholder within a page with a specific name.
  • If we add ,it just duplicates Content.
  • To avoid this sitecore 9 introduces dynamic placeholders
  • Dynamic placeholders is now out of box,using this we can add any number of components or limit number of components(using min,max Property) in a single placeholder.

Syntax:
               DynamicPlaceholder(string placeholderName, int count = 1, int maxCount = 0, int seed = 0)


  • placeholderName - the name of the placeholder. 
  • count - specifies how many placeholders sitecore renders. 
  • maxCount - the upper limit 
  • seed - a number used to calculate a starting value of a generated placeholder key suffix.
  • Example:
  • @Html.Sitecore().DynamicPlaceholder("Placeholder Key"/*, optional parameters*/)

3. Controlling configuration load order
  
 Say Bye to Alpha Order of Configuration files.

  • With Sitecore 9, Sitecore has introduced the concept of configuration layers. Configuration layers provide a way to control the order and separation of user config files from the Sitecore-provided config files.

The layers are defined in the App_Config\Layers.config. 

By default, there are four layers defined:

  • Sitecore - All config files for standard Sitecore components are stored in this folder. The load order for the files in this layer should not be changed, as it will cause some features to not function normally.
  • Modules - This contains the configuration files for Sitecore modules.
  • Custom - This contains all the patch files needed for modifying the default values of Sitecore.
  • Environment  - This contains patch files that are created for non-production such as logging.

<layer name="Custom"includeFolder="/App_Config/Include/">
  <loadOrder>
       <add path="Folder1"type="Folder"/>
       <add path="Folder2/specific.config"type="File"/>
  </loadOrder>
</layer>



Based on the Loadorder, it would first load Folder1 files in alphabetical order, then load specific.config in Folder2, and then load the remaining files in Folder2 in alphabetical order.

You can disable a single file/folder by using the mode attributeYou can disable a single file/folder by using the mode attribute

<layer name="Custom"includeFolder="/App_Config/Include/"mode="off">
</layer>
Or
<layer name="Custom"includeFolder="/App_Config/Include/">
   <loadOrder>
        <add path="Folder1"type="Folder"mode="off"/>
        <add path="Folder2/specific.config"type="File"mode="off"/>
   </loadOrder>
</layer>


4. Sitecore forms 

  • Another Good News,There is no need for WFFM(Web Form for Marketers) because Sitecore Forms is now comes as a Out of Box
  • This is a nice drag-and-drop-style interface which is pretty intuitive to use.
  • You open the Sitecore Forms application from the Sitecore Launchpad.

5. Switching search providers 

            With Sitecore 9, switching search providers is EASY.

Syntax:
 <AppSettings>

  <!-- SUPPORTED SEARCH PROVIDERS    
       Specify the search provider that you want this server to use. The supported search providers are:
        
       Lucene
       Solr
       Azure
        
  Default value: Lucene
  -->
  <add key="search:define" value="Solr" />
</AppSettings>


Custom Configuration Roles:

We can also Define own Custom Roles

<!-- default setting for all server -->
<setting name="MailServer" set:value="smtp.liveserver.com" />
<!-- override for UAT environment -->
<setting name="MailServer"
         set:value="smtp.testservice.net" role:require="EnvironmentUAT" />

Note:

  • The website/web.config file must only have one line using role:define. If there is more than one role:define line, Sitecore only uses the value in the last line.
  • role:define command defines pipe-separated list of configuration roles and role:require command is applied to a XML configuration node within Sitecore include config file the node will be ignored if the boolean expression is false.

6. SIF(Sitecore Installation Framework) everywhere

  • The Sitecore Installation Framework is a Microsoft PowerShell module that supports local and remote installations of Sitecore, and it is fully extensible.

7. Using Set in configuration files

  •  If we need to set two site values ,it is now pretty simple with single line in sitecore 9

<site name="website" virtualFolder="/"
 set:domainPath="/home" set:virtualFolder="/sitecoremodules/site" /> 

8. Connecting to sitecore rocks

Due to some security changes with sitecore 9, we need to add the following in order to work with Rocks 

<location path="sitecore/shell/WebService">
     <system.web>
        <authorization>
           <allow users="?,*" />
        </authorization>
    </system.web>
</location>

9.Infrastructure/software changes

  •  Search:  Solr,Azure is now available
  •  Analytics:  xDB Support
  •  Installation:  SIF 


That's all ..Happy Coding :)

2 comments:

Check the users Logged into the sitecore backend

Hi, Today I'm going to discuss about " how to check the concurrent users logged into the sitecore backend ? ". For this ...