Book Image

Sitecore Cookbook for Developers

By : Yogesh Patel
Book Image

Sitecore Cookbook for Developers

By: Yogesh Patel

Overview of this book

This book will get you started on building rich websites, and customizing user interfaces by creating content management applications quickly. It will give you an insight into web designs and how to customize the Sitecore architecture as per your website's requirements using best practices. Packed with over 70 recipes to help you achieve and solve real-world common tasks, requirements, and the problems of content management, content delivery, and publishing instance environments. It also presents recipes on Sitecore’s backend processes of customizing pipelines, creating custom event handler and media handler, setting hooks and more. Other topics covered include creating a workflow action, publishing sublayouts and media files, securing your environment by customizing user profiles and access rights, boosting search capabilities, optimising performance, scalability and high-availability of Sitecore instances and much more. By the end of this book, you will have be able to add virtually limitless features to your websites by developing and deploying Sitecore efficiently.
Table of Contents (20 chapters)
Sitecore Cookbook for Developers
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Preface

Sitecore Experience Platform (XP), which is more than a content management system (CMS), is global leader in experience management. It continues to be very popular due to its robust framework, continuous innovations, and ease of implementations compared to other CMS available. Developers love Sitecore for its flexibility, scalability, and power. It has great out-of-the-box capabilities, but one of its great strengths is the ease of extending these capabilities.

Sitecore Cookbook for Developers is intended to provide a surprising amount of recipes to use out-of-the-box core capabilities and customize them. It also focuses on helping developers that are new to Sitecore to achieve maximum productivity and satisfaction with minimum efforts. It also includes tips, tricks, and best practices for working with the platform.

What this book covers

Chapter 1, Basic Presentation Components, focuses on creating information architecture and presenting it using out-of-the-box components and different Model-View-Controller (MVC) renderings. It also shows how effectively you can utilize out-of-the-box components to provide greater ease and flexibility for future enhancements.

Chapter 2, Extending Presentation Components, gives examples for extending out-of-the-box components to develop multilingual and multidevice websites, integrate the content with external systems, and provide easier content management for content owners.

Chapter 3, Customizing the User Interface Framework, demonstrates you how to create new interfaces or extend existing interfaces, using different framework components. It also provides some recipes to please content authors.

Chapter 4, Leveraging the Sitecore Backend, gets you completely involved in Sitecore backend architecture. This chapter gives you a brief tour of different the features to extend the core engine using pipelines, processors, events, handlers, hooks, jobs, schedulers, and so on.

Chapter 5, Making Content Management More Efficient, shows you different tricks and techniques to manage the content in a better way and provide better usability with the use of backend and frontend frameworks and different functionalities such as dictionary, validations, rule engine, Rich Text Editor, Item Web API, and so on.

Chapter 6, Working with Media, explores different techniques while working with Sitecore media items such as securing them, serving them through content delivery network (CDN), and utilizing them for responsive web designs.

Chapter 7, Workflow and Publishing, shows how you can extend the workflow and publishing architecture to achieve scheduled publishing and unpublishing, using web deploy while publishing and customizing pipeline and events.

Chapter 8, Security, explains how to create different user profiles and give custom permissions to it. It also explains how to achieve single sign-on (SSO) securely and allow extranet access in a secure way.

Chapter 9, Sitecore Search, describes different techniques for accessing data from indexing. It explains how to implement different search techniques, which modern search engines use such as tagging, autosuggest, boosting search results, finding more like this, and did you mean.

Chapter 10, Experience Personalization and Analytics Using xDB, explains how to provide the best user experience using different techniques of real-time personalization, it is the heart of marketing programs. It also briefs features for engaging users. This chapter will also provide good recipes to use and extend Experience Database (xDB) and generate different analytics reports.

Chapter 11, Securing, Scaling, Optimizing, and Troubleshooting, focuses on different techniques for making the Sitecore environment more secure. It also explains techniques to troubleshoot slowness, create clustered environments to get better performance, high availability, and scalability. It also briefs some techniques to troubleshoot.

Appendix A, Getting Started with Sitecore, contains information to help you in Sitecore installation, and create a project for your Sitecore solution using Microsoft Visual Studio.

Appendix B, Tools and Resources for Sitecore Developers, provides information on tools and resources available for Sitecore developers to install, and maximize their productivity and expertise by using it.

What you need for this book

The minimum requirements for this book would be Sitecore 8 or later, .NET Framework 4.5 or later, ASP.NET MVC 5.1 or later, MS SQL 2008 R2 or later, and IIS 7.5 or later. You can refer to Sitecore Compatibility Table at https://goo.gl/4kkCHe for more details.

It is recommended that you use a plain Sitecore setup to implement the recipes of this book in order to avoid unnecessary conflicts with existing implementations.

To download and install Sitecore and create a project, you can refer to Appendix A, Getting Started with Sitecore, which you will find at the end of this book.

Who this book is for

If you are a Sitecore developer or programmer who wants to expand your Sitecore development skills, this book is ideal for you. As this book targets readers of various experience levels, you should be able to find recipes of beginner, intermediate, and advanced nature. You will need working knowledge of ASP.NET WebForms or MVC, as well as HTML, and a basic knowledge of Sitecore installation.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it, How it works, There's more, and See also).

To give clear instructions on how to complete a recipe, we use these sections as follows:

Getting ready

This section tells you what to expect in the recipe, and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the steps required to follow the recipe.

How it works…

This section usually consists of a detailed explanation of what happened in the previous section.

There's more…

This section consists of additional information about the recipe in order to make the reader more knowledgeable about the recipe.

See also

This section provides helpful links to other useful information for the recipe.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Make sure that you have added a reference of Sitecore.Kernel.dll and Sitecore.Mvc.dll files to the SitecoreCookbook project."

A block of code is set as follows:

<div id="header"> <a href="/">
  @Html.Sitecore().Field("Logo",
    Sitecore.Context.Database.GetItem(
    "/sitecore/Content/Global/Configurations"))
</a> </div>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<div id="sidemenu">
  @Html.Sitecore().Rendering("{2383A57F-21FF-4A77-9E2A-C467F0CEDA57}")
</div>

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "From the ribbon, select Standard Values in the Builder Options tab."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/SitecoreCookbookForDevelopers_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/Content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.