Posts

How to use snippets in SXA project

Image
  Snippets in SXA Snippets enable content editors to work more efficiently by reusing predefined sets of renderings on site pages. You can specify the behavior of snippets reuse in the Content Editor. For example, whether you allow content editors to duplicate and change the snippet locally. Data Source Configuration A unique feature of the snippet, is that the usage can take a couple of paths depending on intent of usage. Through the Content Editor there are three setting options for a snippet item regarding how to handle the data sources of applied to any renderings placed within the snippet. Do not copy  – The default setting. The snippet uses a globally assigned data source. The source of the content is in the site data folder. When you reuse this snippet on different pages and then change it, all instances of the snippet on all pages are updated automatically. Copy global data source to local context upon selection  – A copy of the snippet, its configuration, and con...

Search Page in Sitecore SXA

Image
                              There are three parts of this page : 1. Search Box 2. Search Results  3. Filters 1. Set up Search Box : To enable your visitors to search your site, you can add a search box to your pages. By default, the Search Box rendering adds the search text box to the page. You can customize the search box by configuring the item and changing the properties. To add a search box to your page: From the Toolbox, drag the Search Box rendering to the page. In the Select the Associated Content dialog box, for the search box, select the Default item. 3. In the Select the Associated Content dialog box, for the search box, select the Default item. Search results signature – enter the unique signature of a specific Search Results rendering to limit the search results. This can be convenient when you have more than one search result rendering on the page. Search scope – select a scope to limit the se...

Custom Dropdown in Sitecore form

Image
Custom Dropdown in Sitecore form       1 .  Create a field template         a .   Create a template in /sitecore/templates/System/Forms/Fields.              b.  Inherit this template from Templates/System/Forms/Fields/Dropdown List              c.  Check the  shared  checkbox for all your fields in this template.              d.  Create Standard values. 2 . Create the View Model for custom field and razor view for displaying the form element         a .  Create a class, add the property, and override the InitItemProperties and UpdateItemFields                  methods.             b. Build and deploy.             c. Add a new folder ‘FormsDemo’ and place the view und...

Custom Component in Sitecore SXA

Image
Steps for creating custom component : A. Create a new module: 1. Navigate to /sitecore/system/Settings, right-click Features or Foundation, and insert a new folder. 2. Right-click Features or Foundation, click Insert, and click Module. 3. Enter a name and group the module under the new folder. 4. Check only Site Setup. 5. Click Proceed. Note : Do not place your custom modules in the Experience Accelerator folder. This folder is overwritten during updates. B. Clone Rendering 1. To clone the rendering that you want to use, navigate to /sitecore/Layout/Renderings/ Feature/Experience Accelerator/Page Content/Promo  2. Right-click the rendering that you want to clone.  3. Click Scripts and click Clone Rendering.  4. In the Create derivative rendering dialog box, fill in the following fields: C. Update Old Template Fields 1. Navigate to /sitecore/templates/ Features or Foundation/your folder/Custom ...