Surendra Sharma

Surendra Sharma

Search This Blog

Thursday, February 23, 2023

OData Services in Sitecore

Today, we will be exploring one of the coolest features on the Sitecore: OData Services.

This feature allows you to expose your item data in JSON format in read-only mode. It is incredibly easy to use and configure. To do so, you need to create an OData item API at the settings, services API key section. After you have created it, you can specify its fields, for example, core, allowed control. You can also specify the database to which you want to get the item details. In a production environment, it is mostly on the web.

Once you have configured it, you can access your items by using the Sitecore domain name followed by the OData services API and the item ID or item path. You also need to pass the OData services API key. For example, if you want to access the details of a home item with ID and three fields (title, text, and address), you can use this URL and pass the API key. You will get the item properties such as the item name, path, language, template, creation date, and ID.

http://xp103sc.dev.local/sitecore/api/ssc/aggregate/content/Items('%7B%3Citem%20id%3E%7D')?sc_apikey=%3Capi%20key%3E

To get the field values, you need to pass the query string "$expand=field value".

Here is my YouTube video for the same



Stay tuned for more such articles, tips and tricks.

Saturday, February 18, 2023

When NOT to use Headless CMS

Introduction

Headless CMS is a popular technology that is used to manage and publish content across multiple platforms. However, it's not always the best choice for every website or application. In this blog post, I will explain when not to use a headless CMS and why.

  • Simple Websites with Minimal Content: If your website is small and doesn't require dynamic content, a headless CMS may be unnecessary. For instance, if your website has only a few pages, it's better to use a traditional CMS or a static site generator. You don't need the added complexity of a headless CMS for a simple website.
  • Small Development Teams with Limited Resources: While headless CMS platforms can offer many benefits, they can also be more complex to set up and maintain than traditional CMS. If your development team is small or lacks experience with headless CMS, it may be better to stick with a more familiar technology. Using a headless CMS can add unnecessary complexity to the development process.
  • Content-Heavy Websites with Complex Data Structures: Headless CMS platforms are designed to handle complex content models and data structures. However, if your website has relatively simple content needs, you may not need the added complexity of a headless CMS. In this case, a traditional CMS may be a better option. If your website doesn't require a complex content structure, there's no need to use a headless CMS.
  • Websites with Tight Deadlines: If you're working on a tight deadline, you may not have the time to learn and implement a headless CMS. Traditional CMS platforms are generally quicker to set up and easier to use, making them a better choice for fast turnarounds. If you're under time pressure, it's better to use a traditional CMS platform.
  • Websites with Tight Budgets: While headless CMS platforms can be a great choice for larger websites and enterprise-level applications, they can be more expensive to implement than traditional CMS. If you're working with a tight budget, it may be more cost-effective to stick with a more traditional approach. Using a traditional CMS can help you save money and still achieve your website goals.
  • Multiple Integrations: Traditional CMS may be a better choice if you need to perform multiple integrations in your CMS.
  • Customization: If you anticipate the need for extensive customization of the CMS for administrators or content authors, a traditional CMS might be more suitable than a headless one.

Conclusion: Headless CMS platforms are powerful tools that can help you manage and publish content across multiple platforms. However, they're not always the best choice for every website or application. By understanding when not to use a headless CMS, you can make a more informed decision and choose the technology that's right for your project.

Here is the Youtube video for the same




Sunday, February 12, 2023

Sitecore Comics

I've been working with Sitecore since 2012.

Recently, I had a funny incident where someone asked me to explain what a content management system is. Even though I've been working with Sitecore for a decade, I struggled to explain the question because it was asked by a school boy. I asked the kid what he liked, and he said comics, so I decided to explain it in a way that would be fun for them. 

That's how I came up with the Sitecore comics, which explain Content management systems to kids in an engaging and entertaining way.

Have fun!!!


Here is a Youtube video for the same!!!


Friday, January 28, 2022

Sitecore JSS : Convert YML to JSON

Till yesterday, I knew that to provide content in Sitecore JSS I need to create YML file.

But today I learn that one can also create JSON file as well

Lets suppose we have following Graphql en.yml file

fields:

  pageTitle: GraphQL | Sitecore JSS

placeholders:

  jss-main:

  - componentName: ContentBlock

    fields:

      heading: Using GraphQL with JSS

      content: |

        <p>This is a live example of using Integrated GraphQL and Connected GraphQL with a JSS app.

        For more information on GraphQL use in JSS, please see <a href="https://jss.sitecore.com" target="_blank" rel="noopener noreferrer">the documentation</a>.</p>

  - componentName: GraphQL-Layout

    placeholders:

      jss-graphql-layout:

      - componentName: GraphQL-IntegratedDemo

        fields:

          sample1: Hello integrated GraphQL world!

          sample2:

            href: https://www.sitecore.com

            target: _blank

            text: GraphQL lets you get structured field data too

      - componentName: GraphQL-ConnectedDemo

        fields:

          sample1: Hello connected GraphQL world!

          sample2:

            href: https://www.sitecore.com

            target: _blank

            text: GraphQL lets you get structured field data too

 

I want to convert it to json file which can be easily accopalieshed by visiting https://onlineyamltools.com/convert-yaml-to-json as


I kept this json data in “testymltojson.json” file as 



He is the complete code

{

    "fields": {

        "pageTitle": "GraphQL | Sitecore JSS - YML To JSON"

    },

    "placeholders": {

        "jss-main": [

            {

                "componentName": "ContentBlock",

                "fields": {

                    "heading": "Using GraphQL with JSS - YML To JSON",

                    "content": "<p>This is a live example of using Integrated GraphQL and Connected GraphQL with a JSS app.\nFor more information on GraphQL use in JSS, please see <a href=\"https://jss.sitecore.com\" target=\"_blank\" rel=\"noopener noreferrer\">the documentation</a>.</p>\n"

                }

            },

            {

                "componentName": "GraphQL-Layout",

                "placeholders": {

                    "jss-graphql-layout": [

                        {

                            "componentName": "GraphQL-IntegratedDemo",

                            "fields": {

                                "sample1": "Hello integrated GraphQL world!",

                                "sample2": {

                                    "href": "https://www.sitecore.com",

                                    "target": "_blank",

                                    "text": "GraphQL lets you get structured field data too"

                                }

                            }

                        },

                        {

                            "componentName": "GraphQL-ConnectedDemo",

                            "fields": {

                                "sample1": "Hello connected GraphQL world!",

                                "sample2": {

                                    "href": "https://www.sitecore.com",

                                    "target": "_blank",

                                    "text": "GraphQL lets you get structured field data too"

                                }

                            }

                        }

                    ]

                }

            }

        ]

    }

}


So if you deployed it to Sitecore, this json file will create its item as


Short tip but very useful!!!


Monday, April 5, 2021

The Sitecore Experience Edge Partner Collection

As you know that Sitecore introduce new product Sitecore Hub with Edge.

Sitecore also launched certification course "
The Sitecore Experience Edge Partner Collection" on the same at their eLearning portal.

I registered and follow all the training topics and successfully completed my certification on the same.

Certificate : The Sitecore Experience Edge Partner Collection

 

Tuesday, March 30, 2021

Introduction to the Sitecore ASP.NET Core Rendering SDK

As you know that we can use ASP.NET CORE for developing headless application on Sitecore platform.

Sitecore launched certification course "Introduction to the Sitecore ASP.NET
Core Rendering SDK
" on the same at their eLearning portal.

I registered and follow all the training topics and successfully completed my certification on the same.

 

Sitecore ASP.NET
Core Rendering SDK Certification

 

 

 

Sunday, March 21, 2021

Boxever Advanced Certification

As you know that Sitecore acquired Boxever Ltd. which is a SaaS-based Customer Data Platform (CDP) providing decisioning and experimentation.

Sitecore also launched certification on "Boxever" as their eLearning site.

I registered and follow all the training topics and successfully completed my certification on the same.

Boxever Advanced Certification