Tuesday 7 November 2017

Handling 404 Error Page with Sitecore

Wanna create your own PageNotFound with Sitecore?

Suppose a scenario, where an end user is hitting wrong item and he is getting some technical error (which can not be generally understandable by End User), and you wanted to show him your own page.

Then I would like to say it's cool and quick change with Sitecore, we just need to make an entry into Sitecore Config(<instance name>\Website\App_Config\Sitecore.config) and have to create your own aspx file that's it.


Let's start a quick demo step by step:

1.  First created PageNotFound.aspx file and put it at location [<Instance Name>\Website\PageNotFound.aspx]


2. Second after this made entries to Sitecore.Config [<instance name>\Website\App_Config\Sitecore.config]


404-errorhandling-config

That's It....

custom-404-page-sitecore


@Note: Actually here we are redirecting PageNotFound: 404 Error type with Permanent Redirect: 302 by creating our own user friendly Page.

Please let me know if any feedback or suggestions.

Saturday 14 October 2017

Creating Custom ribbon with Sitecore

Create Custom Ribbon button with Sitecore:


Before start to explain let me tell you that it's very easy to create custom ribbon with sitecore.


So let's start,


First to create custom Ribbon we will goto CORE database.
Sitecore Login Page=> Desktop=> Right bottom Select CORE database



sitecore-desktop-database

To create custom Ribbon,
We need to create first ribbon then Strip and at-last chunks.
Now the Question is what are these ribbon,strip and chunks?
So let me give this answer in One line.
As you can see from the snapshot, "Top Section is Ribbon and the area it covers as subpart are strip and the buttons are chunks."
Now to create custom we will start recursively means first will create Chunks then strips and in last will ribbon.
So all the chunks, strips and ribbons are under ribbon Tree at "/sitecore/content/Applications/Content Editor/Ribbons"

sitecore-content-tree
at this path "/sitecore/content/Applications/Content Editor/Ribbons"
under the chunks,
create custom Chunks of type "/sitecore/templates/System/Ribbon/Chunk"
and made the entry for Header and ID Field for newly created chunk.


sitecore-chunk-item






and now create custom button inside this of type "/sitecore/templates/System/Ribbon/{select your button type template}"
made the field entry for button

sitecore-ribbon
at this path "/sitecore/content/Applications/Content Editor/Ribbons" under the strip, create custom strip of type "/sitecore/templates/System/Ribbon/Strip"


sitecore strip


after creating strip to display created chunk buttons we generally divided them into separate sub parts, so to achieve this goal
we will create custom subpart under strip of type "/sitecore/templates/System/Reference"
and made the entry for reference will point to custom created chunks



at this path "/sitecore/content/Applications/Content Editor/Ribbons" under the ribbons/Default, create custom ribbon of type "/sitecore/templates/System/Reference"
and made the entry for reference field which will be pointing to chunks


That's It.

Now goto to master Database and check the Custom Ribbon.

sitecore-custom-ribbon

Hope it will help!!!