You are previewing Sitecore Cookbook for Developers.
O'Reilly logo
Sitecore Cookbook for Developers

Book Description

Over 70 incredibly effective and practical recipes to get you up and running with Sitecore development

About This Book

  • Build enterprise-level rich websites quickly and deliver the best possible content management to your website

  • Get maximum usage of functionalities like different user interfaces, workflow, publishing, search, analytics, etc and learn different rendering techniques using presentation components for data bindings, events, handlers, schedulers, media, etc.

  • Add a surprising amount of functionality just by customizing the Sitecore architecture through the best practices contained in this book

  • Who This Book Is For

    If you are a Sitecore developer or a programmer who wants to expand your Sitecore development skills, this book is ideal for you. You will need working knowledge of ASP.NET WebForms or MVC, as well as HTML, and a basic knowledge of Sitecore installation.

    What You Will Learn

  • Create, access, and personalize your website content using different Sitecore presentation components

  • Learn how to extend the presentation components to fulfill some real-life requiremnts such as improving the site’s performance, generating Rss feeds and so on

  • Work with multiple websites on a single Sitecore instance and create multilingual websites

  • Customize the Sitecore interfaces as per your business requirements to provide easier and error-free user interface to content authors to save time and improve accuracy

  • Customize the Sitecore backend architecture as per your business needs

  • Automate tasks and achieve scalability by altering the development and configuration settings

  • Integrate external systems with Sitecore to import or export content and secure user interactions

  • Integrate the advanced features of analytics and personalization, to get the best possible customer experience and generate its reports

  • In Detail

    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.

    Style and approach

    This easy-to-follow guide is full of hands-on recipes on real-world development tasks to improve your existing Sitecore system. Each topic is presented with its benefits and detailed steps to achieve it through well-explained code and images.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased 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 code file.

    Table of Contents

    1. Sitecore Cookbook for Developers
      1. Table of Contents
      2. Sitecore Cookbook for Developers
      3. Credits
      4. About the Author
      5. About the Reviewer
      6. www.PacktPub.com
        1. eBooks, discount offers, and more
          1. Why subscribe?
          2. Instant updates on new Packt books
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Basic Presentation Components
        1. Introduction
        2. Creating a simple content page using template and layout
          1. How to do it…
          2. How it works…
        3. Creating a sidebar menu using view rendering and RenderingModel
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Creating breadcrumb using the view and custom model
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Creating carousel using view and controller renderings
          1. How to do it…
          2. How it works…
          3. See also
        6. Placing renderings dynamically using placeholders
          1. How to do it…
          2. How it works…
          3. See also
        7. Empowering the Experience Editor using placeholder settings
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Restricting or swapping rendering controls on placeholders
          1. Getting ready
          2. How to do it…
          3. How it works…
      9. 2. Extending Presentation Components
        1. Introduction
        2. Altering rendering behavior using component properties
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Creating strongly typed rendering parameters
          1. Getting ready
          2. How to do it…
        4. Achieving asynchronous operations using a custom device
          1. How to do it…
          2. How it works…
        5. Creating multilingual content pages
          1. How to do it…
          2. How it works…
          3. There's more…
        6. Generating RSS feeds for syndicated items
          1. Getting ready
          2. How to do it…
          3. There's more…
        7. Improving site performance by caching renderings
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. HTML cache statistics
            2. When to avoid caching
          4. There's more…
          5. See also
        8. Personalizing components
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
      10. 3. Customizing the User Interface Framework
        1. Introduction
        2. Adding a custom command to item context menu
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        3. Creating a gutter to show unpublished items
          1. How to do it…
          2. There's more…
        4. Creating a Sheer UI application using XAML control to list products
          1. How to do it…
          2. How it works…
          3. There's more…
            1. xamlControls
        5. Creating a SPEAK application to list and sort products
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        6. Searching and filtering products using SPEAK
          1. How to do it…
          2. There's more…
        7. Building a custom form to bind product details using SPEAK
          1. Getting ready
          2. How to do it…
          3. There's more…
          4. See also
        8. Creating a custom editor tab in the Content Editor
          1. How to do it…
          2. How it works…
          3. There's more…
        9. Creating a custom experience button using the Field Editor
          1. Getting ready
          2. How to do it…
          3. There's more…
        10. Creating a custom rule to validate item fields
          1. How to do it…
          2. How it works…
          3. There's more…
        11. Creating a custom sorting routine to sort the content tree items
          1. Getting Ready
          2. How to do it…
          3. How it works…
        12. Creating a custom field to save the date time with time zones
          1. How to do it…
          2. How it works…
            1. Making fields editable from the Experience Editor
          3. There's more…
      11. 4. Leveraging the Sitecore Backend
        1. Introduction
        2. Working with multiple sites
          1. How to do it…
          2. How it works…
          3. There's more…
        3. Customizing pipelines to achieve a custom 404 page
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. Patch configuration
          4. There's more…
        4. Creating a custom event handler to auto-publish on an item save
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Achieving a site-specific URL pattern for a multisite environment
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        6. Initializing hooks to subscribe events to prepare an audit trail
          1. How to do it…
          2. How it works…
          3. There's more…
        7. Creating jobs to accomplish long-running operations
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        8. Using a scheduling agent to delete older item versions
          1. How to do it…
          2. How it works…
        9. Scheduling database tasks
          1. How to do…
          2. How it works…
      12. 5. Making Content Management More Efficient
        1. Introduction
        2. Using dictionary domains for multilingual sites on a multisite environment
          1. How to do it…
          2. How it works…
            1. Bind a dictionary to a site
            2. A fallback dictionary domain
          3. See also
        3. Creating vanity URLs for marketing purposes using an alias item
          1. How to do…
          2. How it works…
          3. See also
        4. Centralizing common content using a clone item
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Using a wildcard item to integrate external content
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Placing dynamic content in the Rich Text Editor by replacing tokens
          1. Getting Ready
          2. How to do it…
          3. How it works…
          4. There's more…
        7. Adding a custom tool to the Rich Text Editor to generate tokens
          1. Getting Ready
          2. How to do it…
          3. How it works…
        8. Dealing with user-generated content using an Item Web API
          1. Getting Ready
          2. How to do it…
          3. There's more…
        9. Storing external content using a custom cache
          1. Getting Ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      13. 6. Working with Media
        1. Introduction
        2. Restricting malicious files being uploaded to the media library
          1. How to do it…
          2. How it works…
          3. There's more…
        3. Downloading the media library folder
          1. How to do it…
          2. How it works…
          3. See also
        4. Protecting media files under a disclaimer
          1. How to do it…
          2. How it works…
        5. Achieving responsive images
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Serving media files from CDN or external storage
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
      14. 7. Workflow and Publishing
        1. Introduction
        2. Creating a custom action using workflow
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Achieving time-based automated publishing
          1. How to do it…
          2. How it works…
          3. There's more…
        4. Unpublishing of items
          1. How to do it…
          2. How it works…
          3. There's more…
        5. Using publishing events to send a publish completion e-mail
          1. How to do it…
          2. How it works…
          3. There's more…
        6. Publishing file-based items using web deploy
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        7. Clearing an HTML cache based on published items for a multisite environment
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        8. Customizing the publishItem pipeline to avoid duplicate names on a live site
          1. How to do it…
          2. How it works…
          3. There's more…
      15. 8. Security
        1. Introduction
        2. Working with a custom user profile
          1. How to do it…
          2. How it works…
          3. There's more…
        3. Creating custom access rights for an item
          1. How to do it…
          2. How it works…
          3. There's more…
        4. Achieving a single sign-on by creating a virtual user with custom roles and rights
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Preventing Sitecore from applying security
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Implementing extranet login
          1. Getting ready
          2. How to do it…
          3. How it works…
      16. 9. Sitecore Search
        1. Introduction
        2. Indexing, searching, sorting, and paging content using a search query
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Creating a computed index field for categorization
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Refining search results by tagging based facets
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Achieving the autocomplete feature with a wildcard
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Influencing search results with boosting
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        7. Hunting MoreLikeThis results
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        8. Correcting a search with did you mean
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        9. Managing millions of items using an item bucket
          1. How to do it…
          2. How it works…
      17. 10. Experience Personalization and Analytics Using xDB
        1. Introduction
        2. Personalizing experience based on goals and Engagement Values
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Personalizing content by predicting a visitor's profile
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Storing visitor information in xDB contacts
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Extending xDB by creating a custom contact facet
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Creating a custom rule and condition for personalization
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        7. Automating the engagement plan
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Finding nearby places using the Geolocation service
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        9. Aggregating xDB data to generate custom reports
          1. How to do it…
          2. How it works…
          3. There's more…
        10. Extending analytics reports using custom dimensions
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        11. Creating section-specific analytics reports using custom dimensions
          1. How to do it…
          2. How it works…
      18. 11. Securing, Scaling, Optimizing, and Troubleshooting
        1. Introduction
        2. Profiling and tracing content pages to find out the slowest operations
          1. Getting ready
          2. How to do it…
          3. There's more…
        3. Transferring items from one database to another
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Making security-hardened environments
          1. How to do it…
          2. There's more…
        5. Adding multiple publishing targets for scalability or preproduction
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Creating clustered instances for scalability and performance
          1. How to do it…
          2. There's more…
        7. Getting high availability of Sitecore instances
          1. How to do it…
          2. There's more…
        8. Improving the performance of Sitecore instances
          1. How to do it…
          2. There's more…
            1. Database tuning
            2. CDN
      19. A. Getting Started with Sitecore
        1. Installing Sitecore
        2. Creating a Visual Studio project
          1. Creating a project in the web root
          2. Creating a project outside the web root
        3. Debugging a Sitecore application
      20. B. Tools and Resources for Sitecore Developers
        1. Useful tools for Sitecore developers
          1. Sitecore Instance Manager
          2. Sitecore Rocks
          3. Reflecting on Sitecore
          4. Source control for Sitecore databases
          5. The Sitecore database comparer tool
          6. Glass.Mapper
          7. Continuous integration and deployment
          8. Other products and modules
        2. Useful resources for Sitecore developers
          1. Sitecore documentation for developers
          2. A knowledge base for developers
          3. The Sitecore marketplace
          4. Technical blogs
          5. Social media
          6. Community for Sitecore professionals
          7. Sitecore Support
          8. Sitecore MVP
      21. Index