Sitecore Inteview Questions
1. Templates, Layout, Rendering & Placeholder:
Templates
A template in Sitecore is an item that defines the structure and behavior of other items. Every item in Sitecore is an example of some template. It also defines the sections and fields in which it breaks down into the content. Each section represents the sub-item under the template, and every field is a sub-item under the item of the related section. - Data Template: Data template includes fields and can be specified by editors using the insert page. These are used to specify how data should be entered. Specifically, they determine which field sections, field types, and field names should be included in each item.
- Branch Template: The Branch template enables you to determine the complete branch of templates by building an instance of the branch template to a whole item structure that appears, so the user does need to create them. This allows you to create a set of items instead of just one. Each branch template contains a branch template definition item, which can consist of a single item, a hierarchy of items, or multiple hierarchies of items.
- Command Template: Command template only deals with the command that is evoked when creating a specified template. It is used for the automatic creation of items with business logic.
- Data Template: Data template includes fields and can be specified by editors using the insert page. These are used to specify how data should be entered. Specifically, they determine which field sections, field types, and field names should be included in each item.
- Branch Template: The Branch template enables you to determine the complete branch of templates by building an instance of the branch template to a whole item structure that appears, so the user does need to create them. This allows you to create a set of items instead of just one. Each branch template contains a branch template definition item, which can consist of a single item, a hierarchy of items, or multiple hierarchies of items.
- Command Template: Command template only deals with the command that is evoked when creating a specified template. It is used for the automatic creation of items with business logic.
Layout
The overall structure of the page is defined by the page layout. The page layout is created by a developer, and it may include placeholders for renderings. A rendering is a section of a page that is defined.
Rendering
In Sitecore, renderings are used to display or render a page or part of a page. Some of the renderings in Sitecore are as follows:
- View Rendering: This type of rendering is used in components that involve little logic and don't have database transactions or MVC controllers. This should be used for rendering item content that doesn't require substantial business logic or presentation logic.
- Controller Rendering: With this type of rendering, you supply the model, controller, and view. This should be used for rendering item content that requires significant business logic or presentation logic and relies heavily on external data.
- Item Rendering
- Method Rendering
- Url Rendering
- XSLT Rendering
- Json Rendering
Placeholder
A placeholder is an object in Sitecore that serves as an anchor point for other presentation objects and they allow content blocks to be added in predefined positions. Every placeholder is named using its “key” attribute. Renderings and sub-layouts can be associated with placeholders based on the placeholder key.
There is no way to differentiate two components if both are using the same placeholder key. But in dynamic placeholder we can differentiate them, because key is determined at the time when we are injecting the components into the page layout.
2. Shared vs Final Layout
The Shared Layout section stores the renderings that are shared across all language versions of an item, while the Final Layout section, stores the renderings that are specific to the current language version you are editing.
3. Versioned vs Unversionsed vs Shared
Versioned fields:
By default all the fields are versioned, which means the the field value will be different across different numbered versions and different language versions as well.
Unversioned fields:
There are certain fields whose value is same for all the numbered versions for a specific language, such as “Country Name”, “Employee Name” and etc.
Shared fields:
When the field value doesn’t change across languages and number versions, we should mark that field as shared which means value will be common across supported languages and versions.
4. Types of publishing
- Incremental Publish: It only publishes items currently present in the publishing queue. Modifying or changing an item automatically adds it to the publishing queue. This method of publishing is faster since Sitecore does not utilize resources to compare different versions of items in the publishing queue before publishing them.
- Smart Publish: In this publication, all items that have changed since the last publication are published. A Smart publish compares each item in the master database with its equivalent item in the target database, and if there have been any changes, the item gets published. This involves comparing all items in the database, which is a time-consuming process for publishing an entire website, particularly if there are many items in the content tree.
- Republish: Everything is published there. Every item in the target database is overwritten by the equivalent item in the Master database, even if the item has not changed. By republishing, all obsolete versions are deleted from the target database. It can be used to bring an entirely new web database online, restore a backup of the master database, and add new content languages, publishing targets, and other system elements to the website.
5. In Sitecore, what is a standard field?
The Fields in the Sitecore Standard Template indicate how Sitecore should manage an item, such as when it should be published, which workflow it should be in, which users should be able to access it, and so on. When you pick an item in the Content Editor, the portions of its template appear in the right pane.
6. Define Standard values in Sitecore
For a data template, standard values allow you to establish default field values, default settings, and insert options. They appear as a child item of the data template __Standard Values in the content tree.
7. Accessing Sitecore Database in CD environment to create items in content tree
Sitecore database through code then you will know that we have 3 ways to do it:
- Sitecore.Data.Database db = Sitecore.Configuration.Factory.GetDatabase(“master”);
- Sitecore.Data.Database db = Sitecore.Data.Database.GetDatabase(“master”);
- Sitecore.Data.Database db = Sitecore.Context.Database;
First 2 statements. Consider you want to create items programatically then we hardcode the database to Master and further logic can be to publish it or the Content Authors verify it in Content tree and publish it. In case the piece of code is accidentally deployed on CD environment then the items won’t be created either in Master or Web database because master database is not accessible on CD and we have hardcoded the Master DB in our piece of Code.
Scenario 1 : If you have "master" database definition node in the config file and the "master" database entry in connection string in your delivery server then you can use Web API to create items. Generally, Master database entry should not be in any configuration file of Content Delivery Server but in this case you need to include it.
Scenario 2 :If not, You need to create service on your CM node which creates item in master database and you need to call this service from your CD node.
8. Sitecore Helix:
Helix is a set of guidelines and recommendations for the development of Sitecore websites. Mainly, it describes the overall architecture of the Sitecore solution and explains design principles that are versatile and adaptable to any Sitecore project. It also focuses on reducing dependencies between the modules, how they should be structured, and how individual sites can use them. Helix is a set of recommendations meant to make building, testing, extending and maintaining a Sitecore project.
9. Difference between Content Editor and Experience Editor
- The Content Editor – It’s intended for experienced content authors who are already familiar with Sitecore and its functionality.
- The Experience Editor – It’s intended for content editors who want to write and edit content directly on the page
10. Federated Authentication
You use federated authentication to let users log in to Sitecore through an external provider. Federated authentication requires that you configure Sitecore in a specific way, depending on which external provider you use.
11. Indexing Strategies
- RebuildAfterFullPublish
- RemoteRebuild
- Manual
- OnPublishEndAsync
- OnPublishEndAsyncSingleInstance
- IntervalAsynchronous
- Synchronous
12. Experience Profile
The Experience Profile enables to monitor the key areas of customer experience and interaction, such as visits, campaigns, goals, profiles, automations, outcomes, and keywords. For example, for each contact which events and goals they have triggered as well as how many engagement value points they have accumulated on the website.
13. Headless Benefits
https://www.sanity.io/headless-cms/headless-cms-benefits
Comments
Post a Comment