<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><language>en</language><title>Blog posts by Harinarayanan</title> <link>https://world.optimizely.com/blogs/harinarayanan/</link><description></description><ttl>60</ttl><generator>Optimizely World</generator><item> <title>Replacement Language Settings</title>            <link>https://world.optimizely.com/blogs/harinarayanan/dates/2025/9/replacement-language-settings/</link>            <description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Today I would like to share my learnings about the Replacement Language option in Optimizely CMS and Commerce.&lt;/p&gt;
&lt;p&gt;Replacement language is used to display content in a specific language, whether the requested language content exists on the site or not. This topic may be familiar for few and not for many.&lt;/p&gt;
&lt;p&gt;It may sound like its fallback language, but fallback language content will be displayed if the specific content does not exist in the requested language, whereas replacement language content will be displayed even though the requested language exists. This will be useful inyou are developing content in a specific language but assume that it&#39;s not ready yet to be published; in the interim, we can use this replacement language option to display the master content.&lt;/p&gt;
&lt;p&gt;Below is a place you can set up replacement language.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/link/4f622d24397443eab2b4ca0dba372723.aspx&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above, you can select the Language Settings option.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/link/e7d02f2434084cfdb21b2826ecf69c74.aspx&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;My Learnings&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With the above popup, we will be able to configure the replacement language, and Optimizely&#39;s out-of-the-box logic will take care of displaying all page content in the replacement language.&lt;/p&gt;
&lt;p&gt;However, in some specific contexts, it&#39;s needed custom logic to find the replacement logic and bring that particular content to render; below are a few examples.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In case you have some configurations on the home page or some settings page for across-site usage for different languages, now you have to create custom logic to pull the replacement language for the specific content and get the configuration.&lt;/li&gt;
&lt;li&gt;During a Find search, if you are supplying a language for getting results, you may have to supply the replacement language code for the specific content to get the right language results.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Otherwise the system will pull the results from the current language, which may be Deutsch, whereas in our case we have to get the English content or configurations or results.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To summarize, in the above two cases we have to get the Replacement Language settings from the current page or content. Below are the properties that can be used to get the replacement language code for the page.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/link/0ccb84640457435094db9fb5aea61cc8.aspx&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The above property can be found in the &lt;strong&gt;ContentLanguageSetting &lt;/strong&gt;class.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope this will be helpful for many.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please feel free to place your comments/suggestions/feedback.&lt;/p&gt;
&lt;p&gt;Thanks for reading.&lt;/p&gt;
&lt;p&gt;Hari&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>            <guid>https://world.optimizely.com/blogs/harinarayanan/dates/2025/9/replacement-language-settings/</guid>            <pubDate>Sat, 20 Sep 2025 04:31:17 GMT</pubDate>           <category>Blog post</category></item><item> <title>Content Delivery / Headless API Implementation </title>            <link>https://world.optimizely.com/blogs/harinarayanan/dates/2023/4/content-delivery--headless-api-implementation-/</link>            <description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I was new to the Headless (CD) implementation and learned with the help of existing resources and implemented it successfully for our requirement, so thought of sharing the implementation steps, in case anyone looking for step by step Content Delivery API implementation or Headless Implementation.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Below are the tools/platforms I &#39;ve used for the implementation,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;CMS 11&amp;nbsp;&lt;/li&gt;
&lt;li&gt;React&amp;nbsp;&lt;/li&gt;
&lt;li&gt;ContentDeliveryApi.Cms 2.21.1&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Step: 1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Install the below packages through the NuGet package manager.&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt;&amp;lt;package id=&quot;EPiServer.ContentDeliveryApi&quot; version=&quot;2.19.0&quot; targetFramework=&quot;net48&quot; /&amp;gt;
  &amp;lt;package id=&quot;EPiServer.ContentDeliveryApi.Cms&quot; version=&quot;2.21.1&quot; targetFramework=&quot;net48&quot; /&amp;gt;
  &amp;lt;package id=&quot;EPiServer.ContentDeliveryApi.Core&quot; version=&quot;2.21.1&quot; targetFramework=&quot;net48&quot; /&amp;gt;
  &amp;lt;package id=&quot;EPiServer.ContentDeliveryApi.Forms&quot; version=&quot;2.21.1&quot; targetFramework=&quot;net48&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step: 2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Add the below configs into web.config, I&#39;m not sure 100% knowledge on why this is required but either of those configs should be set to &lt;strong&gt;true,&lt;/strong&gt; and the other one should be set to &lt;strong&gt;false,&lt;/strong&gt; and not both of them set to &lt;strong&gt;true or false&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class=&quot;language-markup&quot;&gt;&lt;code&gt; &amp;lt;add key=&quot;episerver:contentdeliverysearch:maphttpattributeroutes&quot; value=&quot;true&quot; /&amp;gt;
    &amp;lt;add key=&quot;episerver:contentdelivery:maphttpattributeroutes&quot; value=&quot;false&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step: 3&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Add a new Initialization module,&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;using EPiServer.ContentApi.Cms;
using EPiServer.ContentApi.Core.Configuration;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
using System;
using System.Linq;

namespace Alloy.Web.Admin.ContentDeliveryApi
{
    [InitializableModule]
    [ModuleDependency(typeof(ContentApiCmsInitialization))]
    public class ContentDeliveryApiInit : IConfigurableModule
    {
        public void ConfigureContainer(ServiceConfigurationContext context)
        {
            context.Services.Configure&amp;lt;ContentApiConfiguration&amp;gt;(config =&amp;gt; {
                config.Default().SetMinimumRoles(String.Empty);
            });
        }

        public void Initialize(InitializationEngine context)
        {
            //Add initialization logic, this method is called once after CMS has been initialized
        }

        public void Uninitialize(InitializationEngine context)
        {
            //Add uninitialization logic
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once you are done with the above steps you can re-build and run your solution to verify everything okay with the solution.&lt;/p&gt;
&lt;p&gt;If you see your solution is working fine, then you can test Content Delivery API by accessing a site content with the help of &lt;strong&gt;Visual Studio Code&lt;/strong&gt;(I feel it&#39;s a very feasible tool to access Headless content), In case if you don&#39;t have a &lt;strong&gt;REST Client&lt;/strong&gt; in your Visual Studio Code please install the below Extension, It&#39;s really useful during our Headless implementation to test content.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/link/22eaae12d72e4d51afec8c522c10eae7.aspx&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style=&quot;font-size:&amp;#32;14pt;&quot;&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To get site definitions:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://localhost:44300/api/episerver/v2.0/site/&quot;&gt;https://localhost:44300/api/episerver/v2.0/site/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/link/e59bb74c9d6944b89062e77e5c18614e.aspx&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To get your page content: &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://localhost:44300/api/episerver/v2.0/content/420003&quot;&gt;https://localhost:44300/api/episerver/v2.0/content/420003&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To Expand the Content Area/Content reference within Content:&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;a href=&quot;https://localhost:44300/api/episerver/v2.0/content/420003?expand=*&quot;&gt;https://localhost:44300/api/episerver/v2.0/content/420003?expand=*&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;To Get Language-Specific Content:&amp;nbsp;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;a href=&quot;https://localhost:44300/api/episerver/v2.0/site/?language=fr&quot;&gt;https://localhost:44300/api/episerver/v2.0/site/?language=fr&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;In this way, your content is ready to access through Content Delivery API.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Step 4:&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;If you above all are working as expected we can move on to the next step.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The next will be creating the Content type, ViewModel, Controller, Basic view, and React development for fetching data and rendering data.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;In my case had to create all of the above from scratch, maybe your case may differ. So I like to cover those parts in another blog.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;text-decoration:&amp;#32;underline;&quot;&gt;&lt;em&gt;&lt;strong&gt;Please feel free to add your comments, questions, thoughts, or any missing steps.&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;text-decoration:&amp;#32;underline;&quot;&gt;&lt;em&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style=&quot;text-decoration:&amp;#32;underline;&quot;&gt;&lt;em&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thanks for reading. Have a good day.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>            <guid>https://world.optimizely.com/blogs/harinarayanan/dates/2023/4/content-delivery--headless-api-implementation-/</guid>            <pubDate>Fri, 28 Apr 2023 18:14:23 GMT</pubDate>           <category>Blog post</category></item></channel>
</rss>