Saturday, 9 January 2021

Sitecore Interview Questions and Answers Part 2

 

1.      What is standard values in Sitecore?

Standard values were first introduced in Sitecore 5.3 to overcome some of the issues experienced with the predecessors of standard values – “Masters”. In Sitecore 6 masters was completely removed and the concept of standard values took over.

Standard values are a way of having default or fallback values for fields in Sitecore, meaning that when items are created, you can specify a field value that should be used by default. This does not only account for custom fields you build, but also standard fields in Sitecore such as presentations and insert options. This means that you can specify a value on the standard values, and when you create a new item which inherits from this template, it will by default use the values specified on the standard values.

2.      What is standard fields?

Sitecore provides few common fields for all items, these fields are called standard fields.

These fields can help you to:

·         Set icon of your Sitecore item

·         Check last item update status

·         Check the current status of item’s workflow

·         And many more…

3.      What is raw values?

Sitecore always stores field values as plain text in the appropriate Sitecore database (in the Value column of the Fields table).

In Sitecore, there are two ways of getting data out of a field – the raw value or the rendered value.

A field’s raw value is how the data is stored in the underlying database – for simple fields such as Single Line Text, there is no difference between the rendered and raw values; it’s just plain text.

This is not the case for more complex field types, such as General Link, Image, or Rich Text.

Take the raw value of a General Link field, for instance – if you enable raw values in the Content Editor (by clicking the View tab and ticking Raw values) and look at an item with a General Link field, you will see that the value stored in the database is custom XML:

<link linktype="internal" url="/Home/History/Old activities" target="" id="{CB2BC023-C9CF-4086-811E-0952ADFA5AF9}" />

4.      Which field contains item sort value?

Sortorder field under Appearance section contains item sort value. Decrease sort value to move up and increase sort value to move down item in tree.







5.      What is Layout in Sitecore?

Whenever user sends any request to Sitecore through a URL, Sitecore resolves that item by generating visual representation of that item. Layout provide the basic structure of this visual representation. Layout is container which contains different component of the page.

6.      What is difference between droplist and droplink field type?

By the time you reach to this question, you must be knowing that Sitecore always stores field values as plain text in the appropriate Sitecore database (in the Value column of the Fields table).

Sitecore has two different types of drop-down lookup fields that are available: Droplist and Droplink. Both of them function essentially the same way: they point to a Sitecore data item and list its children in a drop-down list for a content editor. This is a great tool because it allows you (as a data designer) to build a nice set of lookup values and not worry that editors will fat-finger these values.

But why are there the two, and what’s the difference between them?

Droplist data type only stores the string value of the item that was chosen by the content editor, while Droplink stores the GUID of the item that was chosen by content editor.





So you may be wondering – so what?

This will cause a problem when you want to read selected item’s field value. If you use droplist, you are not going to get selected item and will get only selected item’s string value. But if you use droplink, you can easily get selected item and then can read any field value of that selected item.

7.      What is pipeline?

A lot of things happens when you request a page in Sitecore which is handled by pipelines. Pipelines define a sequence of processor that implement different functions such as handling page requests, to uploading files and saving items through the UI. If you have a series of tasks, which need to be performed to accomplish a task, then a pipeline may be the way to go.

Each processor in a pipeline contains a method named Process() that accepts a single argument and returns void. This method should return immediately if the processing context is not relevant to the processor. A processor can abort the pipeline, preventing Sitecore from invoking subsequent processors.

Sitecore separates the pipelines into two groups: those defined within the /configuration/sitecore/pipelines and /configuration/sitecore/processors elements in the web.config file. In general, those defined within the /configuration/sitecore/processors define pipelines that operate for UI requests and can interact with the user. Those defined with the /configuration/sitecore/pipelines tend to define system processes.

8.      What is processor?

Each step in pipeline is called a ‘processor’. The sequence of processors within a pipeline is defined in web.config file. Each Processor contains a unique operation and all these steps together create a pipeline.

<pipelines /> define system process such as initialize Sitecore application, load content editor warning. <processors /> define UI process such as copy item, delete item, drag item and so on.

9.      Under which pipeline Sitecore context gets defined?

<httpRequestBegin> under configuration/sitecore/pipelines in web.config pipeline defines Sitecore context.

10.  How many processors are there under <httpRequestBegin> pipeline?

By default there are 19 processors under <httpRequestBegin> pipeline but it may vary based on different modules you have installed in Sitecore.

For example: If you have installed Sitecore DMS then you will find 21 processors under <httpRequestBegin> pipeline.