output
stringlengths
34
25.7k
instruction
stringlengths
81
31k
input
stringclasses
1 value
If you have followed the steps outlined in the documentation for loading the JavaScript Library: https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/javascript-tagging-examples-for-web-pages.html and the JavaScript Library is not loading as expected this could be related to the JavaScript Library Version. Client Version An issue with the Client Version results in a HTTP 403 Forbidden error when trying to load the JavaScript Library. The client version refers to the version of the JavaScript Library you like to use, for the versions of the JavaScript Library see: https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/release-notes-for-javascript-library.html
The Sitecore CDP JavaScript library is not loading on my site why? I'm trying to load the Sitecore CDP JavaScript library but I keep getting HTTP 403 forbidden. What is causing this error?
If you have a converted session or an abandoned session in the timeline for your guest profile, but the amount shown is zero (as shown in the image in the question) then there is likely to be an issue with one of the following: Currency is not valid in the ADD event Price is being sent as a string, not a number in the ADD event Developer documentation for ADD events: https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/send-an-add-event-to-sitecore-cdp.html
In Sitecore CDP, why does my converted session or abandoned session have no amount in the timeline? When my guest has a converted session or an abandoned session, I expect to see the amount in the converted or abandoned amount in timeline, however mine is always showing as zero. Why is this happening?
If the tenant you are using is storing personally identifiable information (PII), e.g. first name, last name, date of birth, address, etc, then the guest’s name will be displayed on the top of the guest profile dashboard. If PII is being stored in the tenant and the guest’s name is not available, then anonymous will be displayed on the top of the guest profile. In the scenario shown the guest has been identified using their email. Once the guest was identified, the guest moved from an unknown visitor to a known customer. However, the guest’s name is not populated in the CDP. Therefore the guest is identified, but the guest’s name ism missing to fully populate the UI. Depending on whether the tenant you are using is storing personally identifiable information (PII) or not, the data that is shown at the top of the guest profile will either a name, or an identifier.
In Sitecore CDP, why is my guest appearing as anonymous at the top of the guest profile? After sending in a successful identity event in Sitecore CDP my guest is still appearing as anonymous at the top of the guest profile. Why is this happening?
I have resolved the issue and would like to post the public IEnumerable<Item> SearchItemsImpl(string s, int p = 10, int o = 0, string of = null, string f = null) { try { var scopesIDs = s?.Split(',', '|').Where(ID.IsID).Select(ID.Parse); var query = this.SearchService.GetQuery(new SearchQueryModel { ScopesIDs = scopesIDs, }, out var indexName); //if o=1 then ascending if (o == 1) query = query.OrderBy((ContentPage i) => i.get_Item<double>(of)); else query = query.OrderByDescending((ContentPage i) => i.get_Item<double>(of)); //filter by passed date if (!string.IsNullOrEmpty(f)) query = query.Where((ContentPage i) => i.get_Item<DateTime>(f) >= DateTime.Now); if (p > 0) { query = query.Take(p); } return query.Select(i => i.Uri).AsEnumerable() .Select(u => Factory.GetDatabase(u.DatabaseName) .GetItem(u.ItemID, u.Language, u.Version)); } catch (Exception ex) { Log.Info(string.Format(&quot;SearchItemsImpl-error-{0}stacktrace{1}&quot;, ex.Message.ToString(), ex.StackTrace.ToString()), ex); } return new List<Item>(); }
How to use orderby in Scriban template? I have to list my upcoming events on the web page. I have created the data source item for holding all the events and each event has event date. I'm using Scriban to display all the events. My question is how should I ignore the passed day events and have to do the order by event date. This is my Scriban Code snippet: <div> {{ for i_child in i_datasource.children }} <div> <h1><a href=&quot;{{ sc_link_url i_child 'CTA'}}&quot;> {{ sc_field i_child 'Title'}}</a></h1> </div> {{ end }} </div> Finally Done As mentioned here How do you create a scriban function which implements the Content Search API? I have created the new search method for my requirements. Created new class file public class GetSortOrder : IGenerateScribanContextProcessor { protected ISearchService SearchService { get; } protected ISortingService SortingService { get; } protected ISiteInfoResolver SiteInfoResolver { get; } public GetSortOrder(ISearchService searchService, ISortingService sortingService) { SearchService =searchService; SortingService = sortingService; } private delegate IEnumerable<Item> SearchItemsDelegate(Item item, string s, string q = null, string o = null, int p = 10, int e = -1, string g = null, double r = -1); /// <summary> /// Search API /// </summary> /// <param name=&quot;s&quot;>ScopeID</param> /// <param name=&quot;p&quot;>NumberOfResults</param> /// <param name=&quot;o&quot;>Order</param> /// <param name=&quot;f&quot;>OrderBy FieldName</param> /// <returns>Result Items</returns> public IEnumerable<Item> SearchItemsImpl(string s, int p = 10, int o = 0, string f = null) { try { var scopesIDs = s?.Split(',', '|').Where(ID.IsID).Select(ID.Parse); var query = this.SearchService.GetQuery(new SearchQueryModel { ScopesIDs = scopesIDs, }, out var indexName); //if o=1 then ascending if (o == 1) query = query.OrderBy((ContentPage i) => i.get_Item<double>((string)f)); else query = query.OrderByDescending((ContentPage i) => i.get_Item<double>((string)f)); if (p > 0) { query = query.Take(p); } return query.Select(i => i.Uri).ToList() .Select(u => Factory.GetDatabase(u.DatabaseName) .GetItem(u.ItemID, u.Language, u.Version)); } catch (Exception ex) { Log.Info(string.Format(&quot;SearchItemsImpl-error-{0}stacktrace{1}&quot;, ex.Message.ToString(), ex.StackTrace.ToString()), ex); } return null; } public void Process(GenerateScribanContextPipelineArgs args) { args.GlobalScriptObject.Import(&quot;sc_searchitems&quot;, new SearchItemsDelegate(SearchItemsImpl)); } } Added in Patch file <processor type=&quot;Foundation.ScribanExtensions.Pipelines.GetSortOrder, Foundation.ScribanExtensions&quot; resolve=&quot;true&quot; /> Updated scriban {{ for i_searchitem in ( sc_searchitems i_datasource &quot;{D7C469EF-8B47-4B19-810F-3ACA1354D979}&quot; o: &quot;EventDate,Descending&quot; p: 50 q:&quot;./*[@@templatename='Events'] &quot; ) }} <li>{{ i_searchitem.Fields['Title'] }}</li> {{ end }} Here, I have mentioned my field EventDate, not working. I could see, it is working as expected with Title Field. So, something i have to add for Date field, s
You can use below JavaScript function &quot;mobileCheck&quot; to check the mobile device for request. window.mobileCheck = function () { let check = false; (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera); return check; }; Call Mobilecheck function to set the channel type. var channeltype; if (window.mobileCheck()) { channeltype = &quot;MOBILE_WEB&quot;; } Thanks, Vikas Chauhan
In Sitecore CDP, how do I know when the guest is using mobile web to pass the MOBILE_WEB channel? When sending stream events into Sitecore CDP, I want to send in the MOBILE_WEB channel if the guest is viewing the website from their phone. How can I do this?
As seen in some of the comments, the -Query option is influenced by the maximum items setting in Sitecore. With this parameter set for the command you are essentially running a Sitecore Query. If you are trying to return items from each site you can use a different parameter set which is not bound by the MaxItems setting. Example: The following walks the tree by looping through the children of each item. $contentsToUpdate = Get-ChildItem -Path &quot;master:/sitecore/content&quot; -Recurse
Get-Item path not working as expected Can anyone explain what's going on here with this Sitecore Power Shell script? We have 2 websites set up on 1 Sitecore instance, they're as follows: /sitecore/content/siteA /sitecore/content/siteB The below query returns all items under /sitecore/content/siteA/ $contentsToUpdate = Get-Item master: -Query &quot;/sitecore/content/siteA//*&quot; The below query returns all items under /sitecore/content/siteB/ $contentsToUpdate = Get-Item master: -Query &quot;/sitecore/content/siteB//*&quot; The line below seems to return all items under /sitecore/content/siteA/ but nothing from siteB. $contentsToUpdate = Get-Item master: -Query &quot;/sitecore/content//*&quot; I was hoping and expecting that the third example would give me pages under both /siteA/ and /siteB/ but it doesn't seem to be doing that despite all 3 of the commands appearing to access sub-directories fine. Cheers, Dan
Our 2.1 data model allows order items with any type to be created in the CDP. The REST API endpoint for creating order items has not yet been released for REST APIs. Using the 2.1 data model order items can be created using: Batch API: https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/sitecore-cdp-order-item-data-model-for-batch-api.html or ORDER_CHECKOUT stream event: https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/send-an-order-checkout-event-to-sitecore-cdp.html We do have a REST API for creating order items in the 2.0 data model. However order items in the 2.0 data model can only create orders with a restricted number of order item types. For details see our documentation for 2.0: https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-0/using-the-create-order-item-function-in-sitecore-cdp-rest-api.html
In Sitecore CDP, can I create orders using the REST APIs? Using the REST APIS (or Interactive APIs) in Sitecore CDP, can I create an order? Can that order have an order item of any type?
Full Stack triggered experiences/experiments cannot be tested before they are made live. A full stack triggered experience must be put live and triggered to test their execution. Once full stack triggered experiences have been triggered details of the execution, including any errors can be seen in the execution report in the operational tab or in the guest timeline. If a full stack triggered experience is using a decision model, the decision model can be tested using the test canvas. If your full stack triggered experience is being triggered when the session is closed, e.g. on abandoned cart or session close, you can close the session early by sending a special event by sending the event type as FORCE_CLOSE. Force close events immediately closes a session without having to wait for point of sale session timeout. Force close events are only used for testing, in live websites sessions end on point of sale session timeout. To easily trigger your full stack triggered experience, you can change the trigger to a custom event for testing e.g. an event with type ‘TEST_TRIGGER’.
In Sitecore Personalize, how can I test full stack triggered experiences/experiments? I have created a Full Stack Triggered Experience in Sitecore Personalize and now I want to test it before making it Live. For Full Stack Interactive Experiences and Web Experiences I have a 'Test' or 'Preview' button beside the 'Start' button but I don't have this same testing functionality available for Full Stack Triggered Experiences. How can I test Full Stack Triggered Experiences?
I suggest to use for such a case Sitecore Powershell Extension. Pls make a backup package of your items before you run the script. Your script will be something like : #get root item $root = gi master:// -id &quot;{D64DCEAD-7154-4444-BAAC-B20288A9C5DE}&quot; # get all fields with are richtext $items = $root | ls -r | %{$item = $_; $_.Fields | ?{$_.TypeKey -eq &quot;rich text&quot;} } $items.Count foreach($i in $items){ Write-Host &quot;Item Path&quot; $i.Item.Paths.FullPath if($temp){ clear-variable(&quot;temp&quot;) } if($replaced){ clear-variable(&quot;replaced&quot;) } $replaced = $i.Value -replace 'texttobereplaced', 'newText' $temp = $i.Item $temp.Editing.BeginEdit() $temp.Fields[$i.Name].Value = $replaced $temp.Editing.EndEdit() }
Search and replace HTML code on multiple pages I have an old image map that appears on 500+ pages. I would like to delete it and replace it with inline SVG. I know you can search and replace text, but is there a way to search and replace code on multiple pages? Our developers tell me Sitecore does not have that functionality, so editing the HTML is on a per-page basis. Is that true? I do not want to edit 500 pages by hand. The image map HTML is stored in a RichText field. As a last resort, if Sitecore does not allow search and replace of HTML, can I download the HTML, edit it, and then upload and overwrite the old pages? I am a content admin/content author, not a developer. Thanks for your help!
To see data in the operational tab for a web experience/experiment you need to set the point of sale in the settings where your Sitecore CDP JavaScript Library is being loaded. // Define the Boxever queue var _boxeverq = _boxeverq || []; // Define the Boxever settings var _boxever_settings = { client_key: '{{clientKey}}', // Replace with your client key target: '{{apiTargetEndpoint}}', // Replace with your API target endpoint specific to your data center region cookie_domain: '{{cookieDomain}}' // Replace with the top level cookie domain of the website that is being integrated e.g &quot;.example.com&quot; and not &quot;www.example.com&quot; web_flow_target: &quot;https://d35vb5cccm4xzp.cloudfront.net&quot;, pointOfSale: &quot;{{pointOfSale}}&quot; // Replace with the point of sale you have configured in your tenant }; // Import the Boxever library asynchronously (function() { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://d1mj578wat5n4o.cloudfront.net/boxever-{{clientVersion}}.min.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); })(); When your web experience/experiment is executed an automatic stream event is sent in the CDP called a TRACKING event. The TRACKING event is the event that is used to update the operational tab. The point of sale that is populated on the TRACKING event relies on the point of sale setup in the settings.
In Sitecore Personalize, Why I can’t see any data in the operational tab for my Web Experience? When creating a web experience in Sitecore Personalize I want to see the experience executions in the operational tab. I can see my web experience executing on my website, but my executions aren't being shown in the operational tab.
There is no way of get fields of archive entry with Sitecore API. ArchiveEntry class contains only information about archiving process (date, origin database, who archived the item) original item ID original item name original item location Archived fields are stored in SQL databases (core, master and web) in ArchivedFields table When item is archived, all the shared fields, versioned fields and unversioned fields are added to ArchivedFields table, item data is added to ArchivedItems table and after it's done, item itself is removed from the original database. EDIT to answer question from the comment Yes, it's possible to get values of archived fields if you query database directly if you know id of the item which is archived. Query like that should do the trick: SELECT af.[VersionId] ,af.[FieldId] ,af.[Value] ,ai.ItemId FROM [ArchivedFields] af JOIN [ArchivedItems] ai ON af.ArchivalId = ai.ArchivalId WHERE ItemId = 'B09F6C56-E59B-420F-A669-130ED3A46C3F'
Get ArchiveEntry fields through the Item API Is it possible to retrieve the fields of an ArchiveEntry type using Sitecore Item API? e.g. archiveEntry.Fields[&quot;FieldName&quot;]
If a control group is not being automatically created when you create a variant, this means you have setup an experience instead of an experiment. If you want to run an AB test with a control group you should set up an experiment. Experiments are for running AB tests, in which a variant is compared against a control group. Experiences are for always on personalisation or operational use cases. In practical terms, when an experiment is created: a control group is automatically created by the platform the sample size can be calculated in the details tab, this sample size is used to determine when the experiment is complete and the performance results can be interpreted. When an experience is created: there is no control group automatically created there is no sample size to be calculated as there is no test running
In Sitecore Personalize, why is a control group is not being created automatically when I create a variant? When setting up an AB test in Sitecore Personalize, I can create a variant but there is no automatic control group getting created.
This is standard behavior of Telerik RTE I'm afraid. color attribute from <span> tags is never removed. You can check that on online demo page of Telerik RTE: https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx Switch to html mode there, paste your html and try clearing content - you will see that you can remove all other styles, but color on <span> will never be removed.
Rich Text Editor - Strip Css Formatting The Strip Css Formatting option in Rich Text Editor does not remove all inline styles. Using the following markup: <h3 style=&quot;color: #222222; background-color: #ffffff; margin: 1em 0px; padding: 0px; line-height: 1.3em;&quot;>Q: What is the outlook for the U.S. economy, as well as fiscal and monetary policy?</h3> <p style=&quot;color:#ff0000; background-color: #000;&quot;> HELLO </p> <p style=&quot;color:#ffff00; background-color:#000;&quot;> <span style=&quot;font-weight: bold; color: #ffffff;&quot;>jello </span></p> Results in: <h3>Q: What is the outlook for the U.S. economy, as well as fiscal and monetary policy?</h3> <p> HELLO </p> <p> <span style=&quot;color: #ffffff;&quot;>jello </span></p> As you can see the last inline style was not stripped out. Is there any explanation for that behavior? Sitecore version 10.1.
A decision model can be used with any Full Stack Interactive, Full Stack Triggered and Web Experiences/Experiments. Web Experiences/Experiments In the Build Section add your decision model in the Decisioning Section In your variant open Advanced Edit to edit the HTML, JavaScript and CSS In the API tab, add the data in JSON that you want to use in your Web Experience/Web Experiment. To add data from your decision model into your payload either use: Snippets, for details see: https://doc.sitecore.com/cdp/en/users/sitecore-customer-data-platform/use-freemarker-snippets-in-an-api-response-for-a-web-experiment.html Data Selector, For details see: https://doc.sitecore.com/cdp/en/users/sitecore-customer-data-platform/use-dynamic-decision-model-data-in-the-api-response.html In the JavaScript or HTML tab, use the data you have returned in the API tab in the design of your Web Experience/Experiment. For details see: https://doc.sitecore.com/cdp/en/users/sitecore-customer-data-platform/using-custom-code-in-a-web-experiment-variant.html Note: When updating the API tab, the output must be valid JSON. Full Stack Experiences/Experiments In the Build Section add your decision model in the Decisioning Section Open your personalisation variant, add the data in JSON that you want to use in your Web Experience/Web Experiment. To add data from your decision model into your payload either use : Snippets, for details see: https://doc.sitecore.com/cdp/en/users/sitecore-customer-data-platform/use-freemarker-snippets-in-an-api-response-for-an-interactive-experiment.html Data Selector, For details see: https://doc.sitecore.com/cdp/en/users/sitecore-customer-data-platform/use-dynamic-decision-model-data-in-the-api-response-for-an-interactive-experiment-648890.html Note: When updating the API tab, the output must be valid JSON.
In Sitecore Personalize, what are decision models? and how can I use a decision model? I know that decisioning is a rule based engine for personalisation, but how can this actually be used in an experiment or experience?
I imagine there are multiple ways, but the following worked for me. Install Azure CLI Navigate to your Kubernetes resource in Azure, specifically the &quot;Overview&quot; tab Click &quot;Connect&quot; in the menu bar Open Powershell as an administrator and run the 2 commands that are listed az account set --subscription YOURSUBID az aks get-credentials --resource-group YOURRESOURCEGROUP --name AKSRESOURCENAME These commands will populate a file in your user folder locally: C:\Users\YOU\.kube We will need this later Download Lens (it's free) and install it Open Lens Because we previously ran the two Azure CLI commands and populated our Users directory, Lens SHOULD prepopulate our cluster. You can verify by selecting the Catalog icon then &quot;Clusters&quot; and view your available clusters The one with the file=~\.kube\config was automatically picked up. The second one was my attempt to copy and paste the contents of the config file in &quot;File > Add Cluster&quot;. Either option should yield the same result Select Workloads > Pods Be sure to change your namespace off the default. (right side of application) Select your mssql container/pod and scroll down to the &quot;Ports&quot; section (about midway) Click &quot;Forward...&quot; You can leave the default settings such as &quot;Open in Browser&quot;. It won't work in a browser but we can quickly see the port number this way. Click &quot;Start&quot; Identify the port it chose. The browser will open at http://localhost:YOURPORT Open Sql Management Studio and connect Server name: it MUST include 127.0.0.1 (NOT localhost) and it MUST use a comma , instead of a colon :. An example, valid server name is 127.0.0.1,59324 Login: Your SQL username (probably 'sa') Password: Your SQL password Note: you can view your environment variables right below the Port forwarding setting, just click the icon of an eye You should now be connected to your MSSQL instance running in AKS. It's definitely slow, but is good enough to execute a few queries.
How to connect to MSSQL hosted in Sitecore AKS Infra I am trying to find a way to run SQL queries in MSSQL that is hosted in a container as part of AKS. I did not perform the deployment, but I have access to the resources within Azure. It uses a mostly standard Sitecore k8s manifest with XP0 and Lighthouse demo. While I understand it is frowned upon to connect directly to SQL when working with Sitecore, sometimes it is necessary. In my case, I need to review the current contacts in xDB and verify they have (or don't have) the facets that I am expected. These are custom facets and I cannot validate via their profile. If I can connect to MSSQL and run a query I can validate the contacts. How can I connect/work with MSSQL when it is hosted in this manner?
When a full stack triggered experience/experiment is triggered, the ref for the event or session that has triggered the experience is available in a property called entity. Entity can be used in a decision model to retrieve details about the trigger, e.g. details of products added to a cart for an experience triggered on abandoned cart. Entity contains a session ref if the experience has been triggered by the end of a session, e.g. session close or abandoned cart. Entity contains an event ref if the experience has been triggered by an event e.g. custom triggers. For details on entity see: https://sitecore.cdpknowledgehub.com/docs/full-stack-best-practices#entity-in-triggered-experiences and https://sitecore.cdpknowledgehub.com/docs/decision-models-testing-and-troubleshooting#testing-triggered-experiences-with-entity
In Sitecore Personalize, how can I use the trigger for my full stack triggered experience/experiment in my decision model? I am creating a triggered experience that is triggered when a session closes. In my decision model, I want to determine personalization based on what happened in the session that closed and triggered the experience. How can I get the session that has triggered the experience in my decision model?
When returning a map from a programmable, the type in the settings needs to be changed to a Map. If the type is not updated, the output will be interpreted as a string by the platform. Decision Tables When using a Map from a programmable in a decision table, follow these steps: Select the programmable as an input. On the Add Input Column page, enter the ‘Name of Column’ as it will appear in the decision table Enter the ‘Map Key’, which is a reference to the attribute in the Map you want to use i.e. map name.attribute Select the Type, depending on the data type of the attribute you are using. d. Once the Input Column is added the decision table can be used as normal Please see an example of the Input Column below:
In Sitecore Personalize, how can I use a Map in my decision table? I am building a decision model with a programmable that returns a map. How can I use attributes from this map in a decision table?
ConnectionStrings.config is usually for existing Sitecore databases (like the core, master, web etc.) connection details or it can include a connection string to a custom database. <connectionStrings> <add name=&quot;core&quot; connectionString=&quot;Data Source=xxx;Initial Catalog=xxx_Core;User ID=xxx;Password=xxx&quot; /> <add name=&quot;master&quot; connectionString=&quot;Data Source=xxx;Initial Catalog=xxx_Master;User ID=xxx;Password=xxx&quot; /> <add name=&quot;web&quot; connectionString=&quot;Data Source=xxx;Initial Catalog=xxx_Web;User ID=xxx;Password=xxx&quot; /> ... ... <add name=&quot;CustomDatabase&quot; connectionString=&quot;Data Source=xxx;Initial Catalog=xxx_CustomDatabase;User ID=xxx;Password=xxx&quot; providerName=&quot;System.Data.SqlClient&quot;/> ... ... </connectionStrings> So if you are trying to read connection related settings in your code, you can use private static read-only string _connectionString = Sitecore.Configuration.Settings.GetConnectionString(&quot;CustomDatabase&quot;); But if you are just want to read some settings (like some API URL, client ID, Client Secrets) that does not belongs to connectionstrings.config file, you can create a patch file: <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore> <settings> <setting name=&quot;SomeAPIClientId&quot; value=&quot;value_goes_here&quot; /> </settings> </sitecore> </configuration> and you can read in code using Sitecore.Configuration reference: private static read-only string _connectionString = Sitecore.Configuration.Settings.GetSetting(&quot;SomeAPIClientId&quot;);
How to read values from ConnectionString config file I want to get values from ConnectionStrings.config. Currently, I hard-coded the string in my code which I copied in ConnectionStrings.config. Is there a way via Sitecore API to fetch values from this config file?
In “System Settings” under “Company Information” the configuration for the Sitecore CDP and Sitecore Personalize tenant is setup, this includes the base currency. The base currency determines what currency all orders will be converted into. Both the original currency and base currency are stored. Both the base currency and the original currency are stored in the CDP and can be used for Personalization. The base currency is the currency displayed on guest profiles dashboards. For example, if an organization's headquarters are in the USA then their base currency is likely to be USD. If a customer completes an order on the UK website in GDP, then this will be converted into the base currency USD in Sitecore CDP. When the original currency is converted into the base currency the FX rates are based on https://openexchangerates.org/
Regardless of what currency I send into Sitecore CDP, it is being converted to another currency. How is the currency setup in CDP? I am sending in ADD stream events into Sitecore CDP or Sitecore Personalize with the currency set to EUR yet the currency is USD in the guest profile. How can I set the currency to EUR? How is the currency being converted?
To get the guest ref using the id you can: Use the JavaScript Library Boxever.browserShow(Boxever.browser_id,Boxever.client_key,function(data){ console.log(data.customer.ref); }, 'json'); or Use the REST Locate endpoint You can use the Guest REST API to perform the locate guests function to return guests using their email address or other identifying information. After you perform the locate guests function, you can use the guestRef included in the response to retrieve the full guest record. $ curl -H &quot;Accept: application/json&quot; \ &quot;https://{apiEndpoint}/v2/[email protected]&quot; REST Locate Endpoint : https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/use-the-locate-guests-function-in-sitecore-cdp-rest-api.html or Use a Full Stack Interactive Experience Create a Full Stack Interactive Experience that given the Browser Id returns the guest ref. Full Stack Interactive experiences are available as part of Sitecore Personalize. Therefore for organizations with Sitecore CDP only, this solution is not available. Full Stack Interactive Experiences Endpoint : https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/sitecore-cdp-flow-execution-data-model-rest-api.html Full Stack Interactive Experiences Overview: https://doc.sitecore.com/cdp/en/users/sitecore-personalize/composing-the-api-response-for-an-interactive-experiment.html
In Sitecore CDP and Personalize, Is it possible to get the guest ref using the Browser Id? I have the browser id of the guest in Sitecore CDP and Personalize, but I want to update the guest using the REST APIs. To update the guest using the REST APIs I require the guest ref. Is there a way to get the guess ref using the browser id?
You can use field renderer like: {{ sc_field i_item 'Link' [['target', '_blank']] }}
Using Sitecore link Manager in scriban script I have a general link that is linking to an item in Sitecore. Path to linked item --> /sitecore/content/home/pageItemWithLayout I am using the below scriban script below to render the item link. <a href = &quot;{{i_item.Link.Target}}&quot; target=&quot;_blank&quot;>Some item Link </a> and HTML is rendered <a href=&quot;/sitecore/content/home/pageItemWithLayout&quot; target=&quot;_blank&quot;>Some item Link </a> is there a way to access a friendly URL for this Sitecore item in scriban similar to how we can use Sitecore LinkManager Sitecore.Links.LinkManager.GetItemUrl(itempath) to get the friendly url? The output required after scriban render is <a href=&quot;/pageItemWithLayout&quot; target=&quot;_blank&quot;>Some item Link </a> This item could also be present in a microsite as well.
You can use args.ProcessorItem.InnerItem to find the current Sitecore Item and then from this Item, you can access any field of that item. So, this is your process method for WorkflowAction class: public void Process(WorkflowPipelineArgs args) { CreateContext(args); } and then in this context method, you can use this args to fetch Sitecore Item: private void CreateContext(WorkflowPipelineArgs args) { Item _innerItem = args.ProcessorItem?.InnerItem; NameValueCollection _params = WebUtil.ParseUrlParameters(_innerItem?[&quot;parameters&quot;] ?? string.Empty); }
How to read parameters from WorkflowPipelineArgs The above action is configured with parameters. How can get the parameter value in WorkflowPipelineArgs? args.parameters returning the null value.
It looks like the official documentation is incomplete and you should also enable columns encryption on the UnlockContactIdentifiersIndex_Staging table on the following columns: Column Encryption Type [UnlockContactIdentifiersIndex_Staging].[Identifier] DETERMINISTIC [UnlockContactIdentifiersIndex_Staging].[Source] DETERMINISTIC For the errors related to stored procedures ending in Tvp, I believe these stored procedures are used by the xDB Collection SQL provider with the Table-Valued Parameters execution strategy only (introduced in SC 9.3) and this strategy is not compatible with Always Encrypted. The documentation indeed asks to switch to the Staging Tables strategy. So these specific errors should be ok to ignore. Not directly related to the error that you described in your question, but still related to the same step 5 that is failing for you, I have also experienced the following errors during the script execution: Msg 22105, Level 16, State 1, Procedure GetContactFacetsChanges, Line 57 [Batch Start Line 1476] Change tracking is not enabled on table 'xdb_collection.ContactFacets'. Msg 22105, Level 16, State 1, Procedure GetContactsChanges, Line 57 [Batch Start Line 2042] Change tracking is not enabled on table 'xdb_collection.Contacts'. Msg 22105, Level 16, State 1, Procedure GetInteractionFacetsChanges, Line 57 [Batch Start Line 2532] Change tracking is not enabled on table 'xdb_collection.InteractionFacets'. Msg 22105, Level 16, State 1, Procedure GetInteractionsChanges, Line 57 [Batch Start Line 3039] Change tracking is not enabled on table 'xdb_collection.Interactions'. The documentation asks to re-enable the change tracking at step 6 after the script executed at step 5, but it looks like the re-enabling needs to occur before to avoid these errors.
Sql Always Encrypted - Error while Restoring the stored procedures I am following the below Sitecore documentation to enable Sql Always Encrypted in Sitecore 9.3 https://doc.sitecore.com/xp/en/developers/93/platform-administration-and-architecture/configure-sql-always-encrypted-for-the-xdb-collection-database.html While execution step 5: &quot;Restore the stored procedures using the script created in step 1&quot; in &quot;Configure Always Encrypted on all shards&quot; section, I am getting below error restoring stored procedure &quot;xdb_collection.UnlockContactIdentifiersIndex&quot; and all stored procedure whose name is ending with &quot;TVP&quot; and Msg 402, Level 16, State 2, Procedure XXXXX, Line 27 [Batch Start Line 9] The data types varbinary and varbinary(700) encrypted with (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'Key-Local-Shard0', column_encryption_key_database_name = 'DB_Xdb.Collection.Shard0') are incompatible in the equal to operator.
A partial design works just the same as the other items/pages when it comes to adding components and styling those. You can open the partial design in the Experience Editor and add all the components you want - including the variants (where you can use Scriban) and styles if needed. You will notice that a partial design has a layout definition, so you can also edit the layout just as you are used to with other items. More information in the official docs: https://doc.sitecore.com/xp/en/developers/sxa/102/sitecore-experience-accelerator/create-and-change-a-partial-design.html
Is there any way to edit partial design using Scriban? Is it possible to style the partial design using the scriban template. For example, I just made the new header partial design for my new site, and I am now clueless on how to style it. I have been styling my other components using Scriban, beacuse I find it really easy to use (for me at least). What is your preffered way of designing/styling the header partial design in SXA Sitecore?
To create an alias: In the Content Editor, select the target item, for example, /Sitecore/Content/Home/HR/Jobs. On the Presentation tab, in the URL group, click Aliases. In the Aliases dialog box, in the Name field, enter the alias name, for example, /jobs or jobs (both are equivalent). Click Add. When you have finished defining the aliases you want, click OK. Without publishing the changes, if you want to check, use the below URL. The below URL points to master database and the preview mode is normal (in this mode you won’t see any toolbar options. The view is pretty similar to public view). http:///sample?sc_database=master&amp;sc_mode=normal
Setting an alias on a page doesn't seem to work new to Sitecore here. I've got a page I wish to set an alias on. In Content Editor I go to the Presentation tab, select Aliases, add my alias then hit save and publish. But it doesn't work. Entering the alias into my browser just leads to a 404 page. Would anyone know if I've missed a step?
Second article you mentioned is just what you need. When they mention &quot;free Sitecore license&quot; they don't mean license that you don't have to pay for. What they mean is that with paid Sitecore license you have only limited number of concurrent users who can be logged in to Sitecore Content Management in parallel. By &quot;free&quot; license, they mean that you will &quot;release&quot; one of the concurrent slots. So yes, you should use DomainAccessGuard.Kick(userSession.SessionID); and if that's not enough for you, try working with TicketManager like in the article you mentioned.
Single Session per user (session revocation) I am trying to achieve one session per user for content management on XP9.3, understand that there don't seem to be an OOTB solution for this. So if a user have previously logged in on chrome onto content management, and subsequently logged in on another device, I would like to revoke the session the earlier chrome session. How can I achieve this programmatically on a paid license. How to Kick a Sitecore User Programmatically mentioned that the DomainAccessGuard.Kick(sessionID) only works for free sitecore license which would not work for my paid version. Sitecore 10 - Single Login Session and Kick Idle User mentioned using DomainAccessGuard.Kick(sessionID) together with BaseTicketManager.RemoveTicket(ticketID) method but seems to be implementation for a free licensing version as well.
Usually if you are returning a property from a decision model to a web experience (e.g. string, Boolean, integer), you need to return that property in the API tab of the web experience and then reference that the property in the HTML tab using: {{#attribute}} If you are returning HTML from a decision model to a web experience, you need to return that property in the API tab and then reference that the property in the HTML tab using: {{{#attribute}}}
In Sitecore Personalize, how can I use HTML passed from a decision model as HTML in a web experience? I have created a web experience that is using a decision model. My decision model is returning HTML and I want this to be used as HTML in my web experience.
It is not possible out of the box. I'm not sure about 10.1, but in 9.1 you needed to: update regex for Reply to input value in Sitecore config: <?xml version=&quot;1.0&quot;?> <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore> <fromReplyToEmailRegexValidator> <param desc=&quot;regexValue&quot;>^(\$[a-zA-Z0-9\-_]+\$)?([a-zA-Z0-9\+\-_\!\$\%\&amp;amp;\*\?]+(?:\.[a-zA-Z0-9\+\-_\'\!\$\%\&amp;amp;\*\?]+)*@(([a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9]+)+)|(\[\d{1,3}(\.\d{1,3}){3}\])))?$</param> </fromReplyToEmailRegexValidator> </sitecore> </configuration> add your processor to SendEmail pipeline before Sitecore.EmailCampaign.Cm.Pipelines.SendEmail.SendEmail, Sitecore.EmailCampaign.Cm processor and replace token value, e.g. like that: public class ReplaceTokenInReplyTo { public void Process(SendMessageArgs args) { if (args.CustomData[&quot;EmailMessage&quot;] is EmailMessage message &amp;&amp; message.ReplyTo != null) { var reply = message.ReplyTo; var indexOf = reply.IndexOf('$'); var lastIndexOf = reply.LastIndexOf('$'); if (indexOf != lastIndexOf) { var token = reply.Substring(indexOf, lastIndexOf - indexOf + 1); var replyTo = args.EcmMessage.ReplaceTokens(token); if (!string.IsNullOrEmpty(replyTo) &amp;&amp; replyTo != token &amp;&amp; new EmailAddressAttribute().IsValid(replyTo)) { message.ReplyTo = replyTo; } else { message.ReplyTo = message.ReplyTo.Replace(token, string.Empty); } } } } }
Update Reply-To Field while using Send Email with EXM Submit Action We are planning to alter the &quot;Reply to&quot; from the message template while sending the email using EXM in Sitecore 10.1.2. Can we pass any value into this field for automated email sends? Is it possible to use token ($email or [email]) in the &quot;Reply to&quot; field in the email template, currently I see it shows error when I try to do that? If this functionality is not available out-of-the-box, is it possible to extend the functionality to pass any value into this field for automated email sends?
A Partial Design in SXA is not the same thing as a Rendering. There are no controllers, views, rendering items etc... A Partial Design is effectively a Sitecore item with presentation applied to either the Shared or Final layouts. Partial Designs are then added to a page via the pages associated Page Design. At render time, Sitecore will gather the pages layout and all the partial designs layouts and merge those together into a fully composed page layout for rendering. As Sumit mentioned in his answer, to add components to a Partial Design, you simply edit the design in the Experience Editor, much in the same way you do on a Page. Some things to note. A partial design will have the same placeholders as a page, OOTB, SXA will give you header, body, and footer placeholders. If you use the header placeholder on your header partial design, this placeholder is no longer available to pages that include that partial design. So if you want to allow components to be placed in the header area on your site, you will need to include a Container component on your partial design, this gives a placeholder that can be used on pages. AFAIK, this is done to simplify the merging of the final layouts when composing the page.
How to create and edit header layout partial design? When I create the partial design for example footer or header how to get the &quot;rendering layout file&quot;? Is it automatically created and I just edit it and if it is not, how can I create one? For example, does it exist in Layout -> Renderings -> ... (name of the partial design).
Yes, there are options to create loops like this in scriban: The offset parameter This is the scriban equivalent of .Skip() in .net. It allows you to start the iteration of the loop by skipping the number of entries specified: {{~ for i_child in i_datasource.children offset:2 ~}} // display something {{~ end ~ }} The limit parameter This is the scriban equivalent of .Take() in .net. It limits the number of items iterated through in the loop. {{~ for i_child in i_datasource.children limit:2 ~}} // display something {{~ end ~ }} You can also use these together: {{~ for i_child in i_datasource.children offset: 2 limit:4 ~}} // display something {{~ end ~ }} Scriban loop language reference: https://github.com/scriban/scriban/blob/master/doc/language.md#95-loops
How can I do more complex loops in my Scriban templates? I can loop through children like this: {{ for i_child in i_datasource.children}} But what if I only want the first 2, or if I want to skip the first 2 and take the next 3? Is this possible in scriban?
Yes, it is possible to finish the session on demand. To achieve it, you must send request looking like this one: _boxeverq.push(function(){ var viewEvent = { &quot;type&quot; : &quot;FORCE_CLOSE&quot;, &quot;browser_id&quot; : _boxever.getID(), &quot;channel&quot; : &quot;WEB&quot;, &quot;page&quot; : window.location.href, &quot;pos&quot; : &quot;Sygnity&quot;, &quot;_bx_extended_message&quot; : &quot;1&quot; }; _boxever.eventCreate(viewEvent, function(data){},&quot;json&quot;); }); The crucial thing here is the type : FORCE_CLOSE
How to force the session end in Sitecore CDP? As a developer I try to integrate Sitecore CDP API what ends up with sending many duplicated requests in very short time. Some of them are user related and I need to reset the session to test the user paths correctly. To do it faster I would like to end the user session on the Sitecore CDP side on demand without waiting until CDP ends it. Is it possible to send a request that will finish the session on CDP side?
You can check with where condition on the id of the HTML tag and replace that with an empty string. if([String]::IsNullOrEmpty($html)) { continue } $divTag = $html.getElementsByTagName('div') | Where { $_.id -eq 'fpCE_version' } if(-not [String]::IsNullOrEmpty($divTag)) { $newText = $html.Replace($divTag, '') $item.Text = $newText } If you want to check with the id: if($html_.id -eq `fpCE_version`) { $item.Text = '' } If you want to check with the class name: $html_.className -eq 'your class name' You can also match with the inner text of the HTML tag: if ($html.innertext -match &quot;8.&quot;) { $item.Text = '' }
How can I run a powershell that looks for a string with random numbers in the string and replace it? So I am tasked with looking through all of the html content areas in my content tree and look for this string: &quot;<div id=&quot;fpCE_version&quot; style=&quot;display:none;&quot;>8.5.1</div>&quot; However the version changes with numbers so this 8.5.1 could be 8.5.7 or 8.4.2, so I need a way of looking for that div and replace it with nothing. Here is what I have for only finding the one version so need help with either regex or any other ideas. Thanks foreach ($item in $itemsToProcess) { $items = Get-ItemField $item foreach($field in $items){ $html = $item.Text if([String]::IsNullOrEmpty($html)) { continue } $newText = $html.Replace('<div id=&quot;fpCE_version&quot; style=&quot;display:none;&quot;>8.5.7</div>', '') $item.Text = $newText } }
You can add a new class for your experience editor mode only on body tag var experienceEditor = Sitecore.Context.PageMode.IsExperienceEditor ? &quot;experience-editor&quot; : string.Empty; you can set this variable on body tag like this <body class =&quot;@experienceEditor&quot;> then using this hierarchy in CSS you can set position static or position relative like below code <style> .experience-editor .header-sticky > .navbar { position: relative; } </style> After applying this navbar will not stick on top. I applied same solution in one of my project, because if we need to write some more styling related to experience specific then we can utilize this experience-editor class added on body tag. Hope it resolved your issue.
How to fix the bug with header set as position fixed in Sitecore 9.3? How to fix the problem of having the navbar as position: fixed in Sitecore 9.3. I saw some solutions on the blogs, but it only fixes the issue on the Sitecore 8 versions. Basically when I open the partial design in Sitecore Experience Editor, I have set my navbar as position fixed in theme css file, and it shows the navbar below the scWebEditRibbon. I also saw that scWebEditRibbon is now position fixed, still it does not fix my issue since I also have position fixed on my element.
While not very obvious, this is caused by file paths being too long (which corresponds to my recent item additions under existing paths). This can be confirmed via shell commands in a Git terminal. Run git status in a terminal session. This returns a lot of data, but if you scroll to the top, just after the command was executed, in my case I saw this: warning: could not open directory 'solutions/MyTHing/src/MyTHing.Connector.MyTHing/serialization/System/MyTHingCustomer Tenant/Tenant Settings/Providers/xConnect/Filter Expressions/Contact Filter Expressions/Filter Contacts with non-empty Segments/': Filename too long warning: could not open directory 'solutions/MyTHing/src/MyTHing.Connector/serialization/System/MyTHingCustomer Tenant/Value Mapping Sets/MyTHingto xConnect Contact Mappings/MyTHingAddress to xConnect Other Addresses/': Filename too long (intentionally obfuscated a bit) The fix is to update the serialization settings. In your root, or close to it, you should have a sitecore.json file. In here, you can modify or add the defaultMaxRelativeItemPathLength property: { &quot;$schema&quot;: &quot;./.sitecore/schemas/RootConfigurationFile.schema.json&quot;, &quot;modules&quot;: [ &quot;src/*/*.module.json&quot; ], &quot;plugins&quot;: [ &quot;[email protected]&quot;, &quot;[email protected]&quot;, &quot;[email protected]&quot; ], &quot;serialization&quot;: { &quot;defaultMaxRelativeItemPathLength&quot;: 100, &quot;defaultModuleRelativeSerializationPath&quot;: &quot;serialization&quot;, &quot;removeOrphansForRoles&quot;: true, &quot;excludedFields&quot;: [] } } In my case, surprisingly the value was 200 to start and I was only able to solve my issues by dropping it all the way to 100. I also deleted the existing folders that had the issues and then re-pulled from Sitecore to populate them fresh. This results in some strange looking folders: However, this is normal and is Sitecore Serialization's way of truncating paths to fit the max length requirement. One final note: this can result in a substantial commit for what may be a simple change, so I would personally recommend starting with this value lower (like 100). Sitecore recommends 100-200 but 200 is far too high once you start nesting items.
Git pathspec error Related To Serialized Items on Disk I am unable to commit any changes in Git due to an issue with my serialized items: fatal: pathspec 'solutions/SomeCustomer/src/Mysolution/serialization/System/Things/Data Access/Value Accessor Sets/Providers/xConnect/xConnect Addresses Facet Value Accessor Set/xConnect Others Property Value Accessor.yml' did not match any files Completed with errors, see above. This follows a wall of errors: This occurs as soon as I try to stage my changes. I recently added items to Sitecore and pulled them via Sitecore Serialization CLI successfully. I am using Sourcetree as my GUI. Sitecore 10.1.
Alright, it seems that the actual problem was the fact that Role 3 was also assigned to the logged in user (as an individual role), so in this case the inheritance breaking was not working. That is how the solution was implemented from the beginning, but only now it started to actually hit us in the face. After removing Role 3 from the logged in users, everything was fine.
Permissions for an item - Role inheritance - Coveo search - Missing results I am struggling with an issue in refining the Coveo search results in a Sitecore 9.3 solution. The problem I am facing is that there are specific items, that I can access just fine in the live websites, but Coveo does not return those in the result set, because of the way permissions are handled. Now, I am not saying that the problem is on the Coveo side, but I am trying to figure out what might be wrong with our solution. The scenario is the following: We have a page on our website called Page 1 for example We set the permissions for that page to be as follows: Role 1 - allow, Role 2 - allow, Role 3 - deny (in the inheritance section). Role 1 and Role 2 are members of Role 3, as set in Sitecore (all of our roles are set up like this). The way it works for us is that it denies access to all users that have the Role 3 assigned, except for the ones that have ones of the roles Role 1 / Role 2 (so it's sort of like we deny everyone until a specific role that allows access) Initially, I thought that maybe we have some processor that would handle this behavior in a different way, but I could not find any. I understand that Deny overrules Allow, but I was wondering what is the behavior that should be when the Allowed roles are actually members of the Deny role. Could anyone help with at least a suggestion? Thanks.
After a moderate deep-dive, this appears to be a bug in the IAR implementation. The short answer is that you need overlap between the database items and IAR items. Long answer below... The problem is defined like this: sitecore (IAR) system (IAR) data exchange (database) top-level child (IAR) many other items (IAR) In this configuration, the top-level child does not appear as a child in the content tree. There are two options to get our items to show up in the content tree. 1 - Install the top-level child as a database item It sounds strange (and it is) but you can create a package of an IAR item and then reinstall it and it will then become a database item. If we do this for our top-level child, install it and recycle the app pool, then we now see the content tree acts properly and displays our items. 2 - Generate the IAR file with the data exchange item If we modify our items.json file and include a reference to the data exchange item (i.e. the next-closest database parent) then we also see the proper content tree. { &quot;name&quot;: &quot;DEF&quot;, &quot;path&quot;: &quot;/sitecore/system/Data Exchange&quot;, &quot;allowedPushOperations&quot;: &quot;createOnly&quot;, &quot;scope&quot;: &quot;SingleItem&quot; }, Best Solution The best solution is for this bug to be patched. In the meantime, the best solution appears to be option 2- since the entire point of the IARs is so that you do not have to install a package.
IAR Items Invisible in Content Tree But Exist I am using Items as Resources (IAR) and have been for weeks now. Now, for some reason I am unable to see the items in the content tree. You can see in the screenshot that the item is searchable and is even viewable via direct access in content editor, but I am unable to find the item through the content tree. Notice that there is no arrow allowing me to expand &quot;Data Exchange&quot;. Again, this was working as expected for a while. I was able to confirm that all of my items exist by selecting the &quot;Data Exchange&quot; item and searching for an empty string: The &quot;175 results&quot; are my items. I have tried recycling the app pool, logging out, clearing the cache, viewing DbBrowser.aspx... nothing changes what I see. Additionally, the logs indicate that it loaded the items correctly: No other errors are present in the logs. Sitecore 10.1 EDIT #1: I also changed my Sitecore.json as it was previously truncating items with long paths. However, this did not make any difference either. EDIT #2: Rebuilt links database, recycled app. No luck.
When I hit the below URL, it was giving HTTP Error 502.5 - Process Failure error. https://sc101identityserver.dev.local/.well-known/openid-configuration: Bad Gateway Later I found that license file at the identityserver website was not valid. So, I changed the license file at /sitecoreruntime/license.xml. Again I checked the above URL and this time it was giving valid JSON response. Now I try to login into Sitecore using Sitecore CLI command and able to see login popup and console error also got fixed. Thanks.
Sitecore Login using CLI Command /.well-known/openid-configuration: Bad Gatway I have Sitecore 10.1 instance in my machine. I would like to login into Sitecore using below Sitecore CLI command on the powershell window: dotnet sitecore login --authority https://SC101identityserver.dev.local --cm https://sc101sc.dev.local/ --allow-write true I am getting below error: Error connecting to https://sc101identityserver.dev.local/.well-known/openid-configuration: Bad Gateway My Sitecore instance is working fine and able to login into Sitecore. Can someone help in fixing this issue? Thanks in advance.
Sitecore shell site is defined inside the file : \App_Config\Sitecore\CMS.Core\Sitecore.Sites.config To verify if the shell site is defined on your sites definition , you can check using yourhostnane/sitecore/admin/showconfig.aspx
Couldn't find sitename 'shell' in sitecore.config in 9.3 for lang fall back I don't see site name shell in version 9.3, but to enable language fall back as per Sitecore documentation we need to add the 'enableItemLanguageFallback' and 'enableFieldLanguageFallback' in shell site. https://doc.sitecore.com/xp/en/developers/92/sitecore-experience-manager/enable-and-set-up-language-fallback.html Do we need to manually include this in the patch file? <sites> <site name=&quot;shell&quot;> <patch:attribute name=&quot;enableItemLanguageFallback&quot;>true</patch:attribute> <patch:attribute name=&quot;enableFieldLanguageFallback&quot;>true</patch:attribute> </site> <site name=&quot;website&quot;> <patch:attribute name=&quot;enableItemLanguageFallback&quot;>true</patch:attribute> <patch:attribute name=&quot;enableFieldLanguageFallback&quot;>true</patch:attribute> </site> </sites>
Every request made to your site that is not cached by a CDN will have some impact on your CD servers. I would first start with addressing how you make your site as fast as possible for the majority of time visitors come to your site. General performance considerations: These are issues you can address to provide a well performing site regardless of CMS technology. Are you caching entire pages with a CDN like Cloudflare and Akamai? A page returned by an edge cache could have a response time of 35ms while hitting Sitecore CDN servers have a response time 10x slower. Are assets such as JavaScript, StyleSheets, and Images cached by a CDN? Most of your assets may never change or are the exact same for 6-12 months. This could significantly reduce the load on your servers. Have you ensured that assets like images are optimized for the web? A 15 MB banner image could wreak havoc on your performance metrics. The list goes on and is likely never ending; you simply abandon further efforts when it's good enough. Behavioral considerations: These are things to think about when approaching Editors about habits they have that impacts site performance. Is scheduled publishing an option? Is there a legal or business reason that everything is treated as critical and does that outweigh any perceived performance issues? Can the Editors be trained to use a Staging/Preview version of the site which allows for an immediate review of content before going to the Live site?
Does publishing items too often affect CD performance? We have a Sitecore solution which has a CM server and a CD server. The solution uses Sitecore publishing service. The editors publishes items every 30 seconds from the CM server. My understanding is that each publish will clear HTML cache which is not good for the performance. But besides that, is there any other drawbacks about publishing items too often? What can be done to improve the site performance if the editors insist that they need to publish that often?
Sitecore would like to support all of those who would like to contribute to the Sitecore Community and based on their contribution become an MVP. If you are part of the Sitecore Community but not sure how to contribute or would like to have more visibility in the community you can sign up as a mentee and Sitecore will assign you a Sitecore MVP to mentor you. If you are a Sitecore MVP and you would like to help other to contribute to the Community and be more visible, you can sign up to be a mentor and Sitecore will assign you a mentee. To apply to the Sitecore MVP mentorship program as a mentor or mentee please send the Sitecore team an email at [email protected] with subject line &quot;Mentor Program&quot; More information on the Sitecore MVP Program website: https://mvp.sitecore.com/Mentor-Program
What is the Sitecore Community Mentor Program and how can I join? I just heard about the Sitecore Community Mentor Program, but what it is really and how can I join?
Got the resolution to the issue. The publish configuration setting was in Release mode, when changed to debug it worked.
Cannot debug the Sitecore code in Visual Studio I tried the procedure mentioned in the link https://www.youtube.com/watch?v=bboda7Gj5Hc&amp;list=PLLYksLXV8OcG3-fKtMJgDixBFo3kfeCpD&amp;index=21. But the breakpoints does not get hit and plus the code is published in debug mode. Followed the following steps: Details: Sitecore 10.2 Visual Studio 2022 Visual Studio -> Debug -> Attached to process (w3wp.exe)-> added breakpoints Refreshed the hosted site Is there anything I am missing?
If you would like a license, please email [email protected] and the team will get back to you as soon as possible. More information on what can you do with your Sitecore MVP Licence: What can I do with my Sitecore MVP license?
My MVP license is expire, how can I request for new one? I have been awarded Sitecore MVP this year and my last year's Sitecore MVP license is expired. What is the process to request for new Sitecore license?
You can try below things Put Sitecore cache on particular component. Check if unnecessary JS and CSS files rendered on page, tried to render those in optimize format. It will help you to improve page performance Render images according to container size from server side by setting up height and width parameter on image. Move all JS files at bottom on page.
Optimize Homepage Load Speed Any way I can reduce these numbers? This is the only page that loads incredibly slow compared to others. I enabled Debug in Experience Editor to see this. Sometimes the page loads slow sometimes it loads fast
Thanks to this article from Maarten Willebrands, the issue is that Sitecore, pre 9.3, is configured to try and index too many things at once. When 9.3 was released they lowered the number. https://www.maartenwillebrands.nl/2021/01/22/xconnect-search-indexer-high-memory-usage/ The setting is the SplitRecordsThreshold and it is located in the file C:<Path to xConnect>\App_data\jobs\continuous\IndexWorker\App_data\Config\Sitecore\SearchIndexer\sc.Xdb.Collection.IndexerSettings.xml Controls the limit for the number of records loaded into memory (per core) by the indexer at any one time. If the indexer is using too much memory, decrease this value. To disable splitting, set this value to 0, a negative value, or remove the element completely. The default in 9.1, the setting is 25000. But in 9.3+ the setting is 1000. I changed the number it 1000 and the indexing proceeds at a controlled pace and no longer consumes all the memory of the server. https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-platform/configuring-the-xconnect-search-indexer.html
Very high xDB search indexer memory and out of memory crash Recently my xDB search indexer service (XConnectSearchIndexer.exe) has been using all the server RAM and half the CPU until it runs out of memory crashes. It restarts and immediately starts to consume all the memory again. Any way of knowing what is causing the high CPU usage or any way to limit the memory consumption of the indexer service. Sitecore 9.1
Based on your question it seems like these are static assets on your server which are perhaps generated by a frontend build process. I'm having a similar requirement and use an outbound rewrite rule to accomplish this, see sample below. Another approach would be to set this in Application_BeginRequest. <outboundRules> <rule name=&quot;Set long cache time&quot; preCondition=&quot;SetLongCache&quot;> <match serverVariable=&quot;RESPONSE_cache-control&quot; pattern=&quot;(.*)&quot; /> <action type=&quot;Rewrite&quot; value=&quot;max-age=31536000&quot; /> </rule> <preConditions> <!-- Change condition to meet your requirement --> <preCondition name=&quot;SetLongCache&quot; > <add input=&quot;{HTTP_URL}&quot; pattern=&quot;SignUp\.(.*)\.css&quot; /> </preCondition> </preConditions> </outboundRules>
Custom cache settings for JS/CSS resources Is it possible to set the cache for JS and CSS files only based on some logic? When the url of the assets always changes (e.g SignUp.[versiontoken].css when the content is modified) then the cache settings can be (1 year) Cache-Control: max-age=31536000 When the url is static (e.g /ui/some.css) then the cache should be short (<1day). For the first scenario, I think is enough to add Cache-control in the web.config, but for the second one, what should I do? <httpProtocol> <customHeaders> <remove name=&quot;Cache-Control&quot; /> <add name=&quot;Cache-Control&quot; value=&quot;public, max-age=31536000&quot; /> </customHeaders> </httpProtocol> Project: Sitecore 9.3 based on Helix architecture, no SXA
Instead if using GetEntries method which accepts entry id, you can use public virtual IEnumerable<ArchiveEntry> GetEntries(int pageIndex,int pageSize) like var archive = Sitecore.Context.Database.Archives[&quot;archive&quot;]; var archiveEntriesForItem = archive.GetEntries(0, int.MaxValue).Where(e => e.ItemId == itemId);
Get all items in Archive and Recycle Bin The code I know for getting the archive is Sitecore.Context.Database.Archives[&quot;archive&quot;]. I checked the method and it has GetEntries() but it needs to be supplied with ItemID. Is it possible to get all items in the archive/recycle bin thru API?
First of all, you need to have any AI service (3rd party or your own) that provides Web API endpoints for communication. Then you need to create new AI connection in CDP and configure it: After that, you will be able to add your created connection in Decision model and use it (you will see it in dropdown list when you add &quot;Analytical Model&quot; to canvas): If you need full example with implementation, you can see my blog post here: https://www.brimit.com/blog/cdp-4-how-to-use-ai-connections or watch my user group presentation here: https://youtu.be/iGLMDlItv58
How to create an AI model and use in Boxever Decision or Sitecore CDP decisioning In Boxever or Sitecore CDP decision Model canvas there is an option to create Analytical Model. How to create an AI model and use it in creating decision in Boxever or Sitecore CDP? Could not find any example, any suggestions or help will do.
There is a pipeline called getVariants. It's responsible for creating the list of available variants. You would need to rearrange processors there: <getVariants> <processor type=&quot;Sitecore.XA.Feature.Composites.Pipelines.GetVariants.SwitchPageTemplateId, Sitecore.XA.Feature.Composites&quot; resolve=&quot;true&quot;/> <processor type=&quot;Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSystemVariants, Sitecore.XA.Foundation.Variants.Abstractions&quot; resolve=&quot;true&quot;/> <processor type=&quot;Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSiteVariants, Sitecore.XA.Foundation.Variants.Abstractions&quot; resolve=&quot;true&quot;/> <processor type=&quot;Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetLinkedVariants, Sitecore.XA.Foundation.Variants.Abstractions&quot; resolve=&quot;true&quot;/> <processor type=&quot;Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSharedVariants, Sitecore.XA.Foundation.Variants.Abstractions&quot; resolve=&quot;true&quot;/> <processor type=&quot;Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.FilterVariants, Sitecore.XA.Foundation.Variants.Abstractions&quot; resolve=&quot;true&quot;/> </getVariants> GetSharedVariants should be before GetSiteVariants processor. Patch file like this should do the trick: <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?> <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:env=&quot;http://www.sitecore.net/xmlconfig/env/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore> <pipelines> <getVariants> <processor type=&quot;Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSharedVariants, Sitecore.XA.Foundation.Variants.Abstractions&quot;> <patch:delete /> </processor> <processor type=&quot;Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSharedVariants, Sitecore.XA.Foundation.Variants.Abstractions&quot; resolve=&quot;true&quot; patch:before=&quot;processor[@type='Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSiteVariants, Sitecore.XA.Foundation.Variants.Abstractions']&quot; /> </getVariants> </pipelines> </sitecore> </configuration>
Is it possible to show shared site rendering variant at the top of variant drop down? Is it possible to show shared site rendering variant at the top of variant drop down? Currently, We have rendering variant in shared site and actual site and it is showing actual site rendering variant at the top after that shared site rendering variant. We would like to show shared site rendering variant at the top of dropdown?
Most probably your website uses wrong certificate or certificate already expired. Create new certificate: Start powershell as administrator and run New-SelfSignedCertificate with proper parameters. Depending on your powershell version, you may need to include different set of parameters, so best check New-SelfSignedCertificate documentation if the one below doesn't work for you: New-SelfSignedCertificate -DnsName &quot;your.local&quot; -CertStoreLocation &quot;cert:\LocalMachine\My&quot; That will create new certificate in your personal store. Add new certificate to trusted store Start Microsoft Management Console by running mmc.exe Click File -> Add/Remove Span-in Double click Certificates and select Computer Account, then select Local computer if asked. Expand Personal and select Certificates. You should see your new certificate there. And potentially the old one as well. You can distinguish them by Expiration Date. Remove the old one if it's there. Copy new certificate to Trusted Root Certification Authorities\Certificates (e.g. drag and drop with ctrl key pressed). Check if new certificate is there in Trusted Root Certification Authorities\Certificates and remove old one if it's there. Update binding on IIS Go to IIS manager, select your site and edit bindings. Select your new certificate: Retest in browser That should do the trick. Open your browser (best in private mode as certificates can be cached e.g. in chrome) and check if your new certificate is used and marked as secure:
Getting SSL certificate issue in existing local site Getting a SSL certificate issue in existing site in local system. Could someone assist me how I can resolve this ?
To change the Field type of for an item, you need to go to the template of that item and then update the Field Type for that particular field. You can use the below Sitecore Powershell script to traverse through all the templates and find the &quot;General Link&quot; type field and update it to the new type. $allItems = Get-ChildItem -Path &quot;master:/sitecore/templates/Sample/Test&quot; -Recurse $allItems | ForEach-Object { if ($_.TemplateName -eq 'Template field' -and $_.Type -eq 'General Link' ) { $_.Editing.BeginEdit() $_.Type = 'Custom General Link' $_.Editing.EndEdit() } }
Change field type via a Powershell Script I have created a custom field type which inherits from general link but has an extra attribute we need. We only want it to be used for a particular microsite. Now I want to write a script so that I could change all the general links for a particular location in the content tree to be my new field type. I'm trying to use $field.Type = &quot;My Custom Link&quot;, but getting 'Type' is a ReadOnly property error when I run the script. Is there actually a way to do it via PowerShell?
First of all you need to duplicate the item /sitecore/content/Applications/Content Editor/Context Menues/Default/Duplicate from core db On Message field you have item:duplicate command. You need to create your custom command and to set it to the new created item. You need to register you custom command in a patch config file <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?> <configuration> <sitecore> <!-- COMMANDS --> <commands> <command name=&quot;item:customduplicate&quot; type=&quot;YourNameSpace.CustomDuplicate,YourAssembly&quot; /> </commands> </sitecore> </configuration> The item:duplicate command looks like: using Sitecore.Data.Items; using Sitecore.Diagnostics; using System; namespace YourNamespace { /// <summary>Represents the Duplicate command.</summary> [Serializable] public class Duplicate : Command { /// <summary>Executes the command in the specified context.</summary> /// <param name=&quot;context&quot;>The context.</param> public override void Execute(CommandContext context) { if (context.Items.Length != 1 || context.Items[0] == null) return; Sitecore.Shell.Framework.Items.Duplicate(context.Items[0]); } /// <summary>Queries the state of the command.</summary> /// <param name=&quot;context&quot;>The context.</param> /// <returns>The state of the command.</returns> public override CommandState QueryState(CommandContext context) { Error.AssertObject((object) context, nameof (context)); if (context.Items.Length != 1) return CommandState.Disabled; Item parent = context.Items[0].Parent; return parent == null || !parent.Access.CanCreate() || !context.Items[0].Access.CanWriteLanguage() ? CommandState.Disabled : base.QueryState(context); } } }
Create custom item Duplicate option in content editor We want to create custom item duplicate functionality just like OOTB Duplicate option provided by Sitecore. Has anyone implemented such functionality using either powershell or .net code. How we can do it?
\App_Config\Sitecore\Experience Editor\Sitecore.ExperienceEditor.Speak.Requests.config configuration file contains declarations of server requests for Sitecore Experience Editor. The datasource usages account functionality is inside configuration: <!-- Datasource Usages --> <request name=&quot;ExperienceEditor.Datasources.GetDatasourceUsagesCount&quot; type=&quot;Sitecore.ExperienceEditor.Speak.Ribbon.Requests.DatasourceUsages.GetDatasourceUsagesCount, Sitecore.ExperienceEditor.Speak.Ribbon&quot; resolve=&quot;true&quot;/> <request name=&quot;ExperienceEditor.Datasources.GetDatasourceUsagesDialog&quot; type=&quot;Sitecore.ExperienceEditor.Speak.Ribbon.Requests.DatasourceUsages.GetDatasourceUsagesDialog, Sitecore.ExperienceEditor.Speak.Ribbon&quot; resolve=&quot;true&quot;/> <request name=&quot;ExperienceEditor.Datasources.GetDatasourceUsagesDropdown&quot; type=&quot;Sitecore.ExperienceEditor.Speak.Ribbon.Requests.DatasourceUsages.GetDatasourceUsagesDropdown, Sitecore.ExperienceEditor.Speak.Ribbon&quot; resolve=&quot;true&quot;/> <request name=&quot;ExperienceEditor.Datasources.GetDatasourceUsagesWithVersions&quot; type=&quot;Sitecore.ExperienceEditor.Speak.Ribbon.Requests.DatasourceUsages.GetDatasourceUsagesWithVersions, Sitecore.ExperienceEditor.Speak.Ribbon&quot; resolve=&quot;true&quot;/> <request name=&quot;ExperienceEditor.Datasources.GetDatasourceUsagesWithLockedStatus&quot; type=&quot;Sitecore.ExperienceEditor.Speak.Ribbon.Requests.DatasourceUsages.GetDatasourceUsagesWithLockedStatus, Sitecore.ExperienceEditor.Speak.Ribbon&quot; resolve=&quot;true&quot;/> <request name=&quot;ExperienceEditor.Datasources.GetDatasourceUsagesWithFinalWorkflowStep&quot; type=&quot;Sitecore.ExperienceEditor.Speak.Ribbon.Requests.DatasourceUsages.GetDatasourceUsagesWithFinalWorkflowStep, Sitecore.ExperienceEditor.Speak.Ribbon&quot; resolve=&quot;true&quot;/> <!-- Datasource Usages --> You need to look on GetDatasourceUsagesCount . You can also try too look on frontend side to disabled the call which show you the number of Datasource usages. You have to edit: \sitecore\shell\Applications\Page Modes\ChromeControls.js and you need to update the function renderDatasourceUsagesCommand Your function will be: renderDatasourceUsagesCommand: function () { var container = $sc(&quot;&quot;); return container; }
Disabling the Usage button that show associated content used number on the experience editor We have a shared datasource item that has been used many times on a component across the site. When click the component on the experience editor, the browser freezes. Is there anyway to disable the &quot;Usage&quot; button on the toolbar so that the performance can be improved?
Simpler Way: You can put $name to the alt field in the standard value of an image /sitecore/templates/System/Media/Unversioned/Image/__Standard Values. This way if content authors forget to fill the alt field during upload or in the case of batch upload, it is pre-filled with the file name. Sitecore Powershell way: The above method will work for future uploads but if you want to populate the alt tags for already media files, you can run below powershell script: $mediaItemContainer = Get-Item &quot;master:/sitecore/media library/MyImages&quot; $items = $mediaItemContainer.Axes.GetDescendants() | Where-Object { $_.TemplateID -ne [Sitecore.TemplateIDs]::MediaFolder -and $_.Fields[&quot;Alt&quot;] -ne $null } | Initialize-Item foreach($item in $items) { if(-not($item.&quot;Alt&quot;)) { $item.Editing.BeginEdit() $item.Fields[&quot;Alt&quot;].Value = $item.Name $item.Editing.EndEdit() } }
Is there a way to enable 'alt text' for multiple images using Batch upload When uploading multiple images using Batch upload, there is no ability to add alt text at once. Is there a way to allow/add distance alt text to multiple images during upload without having to open and edit each item? Can we achieve this using SPE?
SXA provides 2 types of sort order OOTB - Sort by Names Sort by Count But to achieve sort order as per your requirement, you need to create a custom sort order for that. First, need to add __Sortorder in the index - <sitecore> <contentSearch search:require=&quot;solr&quot;> <indexConfigurations> <defaultSolrIndexConfiguration type=&quot;Sitecore.ContentSearch.SolrProvider.SolrIndexConfiguration, Sitecore.ContentSearch.SolrProvider&quot;> <fieldMap type=&quot;Sitecore.ContentSearch.SolrProvider.SolrFieldMap, Sitecore.ContentSearch.SolrProvider&quot;> <fieldNames hint=&quot;raw:AddFieldByFieldName&quot;> <field fieldName=&quot;__Sortorder&quot; returnType=&quot;long&quot; /> </fieldNames> </fieldMap> </defaultSolrIndexConfiguration> </indexConfigurations> </contentSearch> </sitecore> Also need to remove this from excludedfield list - <exclude hint=&quot;list:AddExcludedField&quot;> <__SortOrder> <patch:delete/> </__SortOrder> </exclude> Now we create our facet to point it to the _Sortorder field. For that Navigate to your site facets node /sitecore/content/tenant/site/Settings/Facets Add new item using following template /sitecore/templates/Feature/Experience Accelerator/Search/Settings/Facets/IntegerFacet Add the facet to the Sorting Group - And select it on the Search Results component properties - And here you have it, the results are now being sorted with the same order as the content tree. You can follow the .below blog for that - https://www.sitecoreinsiders.com/sxa-search-results-sorting-by-sortorder-field/
SXA Search Result Sort Order Is there any way to do the sorting by Sitecore content tree order? I am working on Sitecore SXA components to build the page. I am using search scope for list down the result. I have created the new index field for sort order field, but some of the items not updating properly and one more thing I would like to do the sorting irrelevant of folder structure. **Parent folder**: *Child folder 1:* Item 1 Item 3 *Child folder 2:* Item 6 *Child folder 3:* Item 5 Item 4 So, I am expecting the order in Item 1, Item 3, Item 6, Item 5,Item 4. If I change the tree order, it should work irrelevant of child folders
If I understand well, you have the same content but just translated on many languages. For my point of view, it would be better to use alternate to manage hreflang. For example:- For Switzerland website with fr-ch and de-ch languages. When you call https://yourwebsite.com/fr-ch/solutions. HTML generated should look like this : <link rel=&quot;canonical&quot; href=&quot;https://yourwebsite.com.com/fr-ch/solutions&quot; /> <link rel=&quot;alternate&quot; href=&quot;https://yourwebsite.com.com/fr-ch/solutions&quot; hreflang=&quot;fr-CH&quot; /> <link rel=&quot;alternate&quot; href=&quot;https://yourwebsite.com.com/de-ch/loesungen&quot; hreflang=&quot;de-CH&quot; /> Please don't hesitate to tell me if it answers to your question ? Thanks!
Sitecore SXA Multi Language Canonical Best Practice I'm working on Canonical implementation on SXA, Sitecore 10.2. Self referencing canonical is working fine, So I have a doubt on Multi language Canonical url. I have a page like this one www.myhome.com/en/page1 . I have similar content in FR,DE,CA languages, so I would like to add these three URL in my Page 1 .I am expecting to deliver <link rel=&quot;canonical&quot; href=&quot;https://www.myhome.com/en/page1&quot;/> <link rel=&quot;canonical&quot; href=&quot;https://www.myhome.com/FR/page1&quot;/> <link rel=&quot;canonical&quot; href=&quot;https://www.myhome.com/DE/page1&quot;/> <link rel=&quot;canonical&quot; href=&quot;https://www.myhome.com/CA/page1&quot;/> Is there any best practice to achieve this, I have to give the option to my content Author to choose the canonical page in backend. There is no OOTB available for this. Please give some suggestions on it.
As far as I can tell from your screenshot, your field type is text_general that uses StandardTokenizerFactory (like this): <fieldType name=&quot;text_general&quot; class=&quot;solr.TextField&quot; positionIncrementGap=&quot;100&quot; multiValued=&quot;false&quot;> <analyzer type=&quot;index&quot;> <tokenizer class=&quot;solr.StandardTokenizerFactory&quot;/> <filter class=&quot;solr.StopFilterFactory&quot; words=&quot;stopwords.txt&quot; ignoreCase=&quot;true&quot;/> <filter class=&quot;solr.LowerCaseFilterFactory&quot;/> </analyzer> <analyzer type=&quot;query&quot;> <tokenizer class=&quot;solr.StandardTokenizerFactory&quot;/> <filter class=&quot;solr.StopFilterFactory&quot; words=&quot;stopwords.txt&quot; ignoreCase=&quot;true&quot;/> <filter class=&quot;solr.SynonymFilterFactory&quot; expand=&quot;true&quot; ignoreCase=&quot;true&quot; synonyms=&quot;synonyms.txt&quot;/> <filter class=&quot;solr.LowerCaseFilterFactory&quot;/> </analyzer> </fieldType> Indexing: your { } characters are ignored by StandardTokenizerFactory on indexing level and are used to tokenize your text. I don't see a reason to use text_general for URLs, why you don't use string? If you really need text_general for your field: best option is to create your own field type with your specific tokenizer behavior (instead of changing text_general schema). You can use WhiteSpaceTokenizer, PatternTokenizerFactory, KeywordTokenizerFactory depends on your needs instead of StandardTokenizerFactory. Quering: your workaround by using \ for escaping should work for quering. But your text_general field type uses the same StandardTokenizerFactory for querying, so your { } are also escaped from your query. So, best solution is to change your field type to string. If you cant do it by some reasons - implement your own field type with needed tokenizers on indexing and querying levels. P.S. I am not 100% sure for querying with {, as far as I remember it was a bug in old Sitecore versions with Lucene search that Sitecore force calls Lucene QueryParser.Escape on query time, but I hope it was fixed a long time ago and it works fine with querying without StandardTokenizerFactory.
How to search only curly braces i.e. { } in Solr search using Solr URL As shown in the picture, I have some tokens in a computed field and want to search all those fields which have { }, but not able to do so, although I have put escape sequence i.e. I have tried to execute the same from Sitecore and have not been able to find any records as well. After looking into Solr query find that it removes { from search text, as shown below So should we assume that we can't search {} in Solr or there is any workaround for it?
You app pool is probably recycling in the early morning when it dies. The default is 1740 minutes. If you move this to a time when the long process is complete, it should complete without issue. Right click on your site app pool and select recycling from the list.
Large nightly scheduled task doesn't complete - site seems to recycle during the task, causing it to end prematurely I have a scheduled import task that runs nightly on our CM instance. The task is huge - it pulls tens of thousands of products from an API and updates, creates, or deletes all of the corresponding product items in the Sitecore database. When I trigger the task manually, it takes about an hour to complete. The task runs nightly but often, we find that certain products haven't synced, or they've updated but didn't get published. Based on the logs, it appears that the process just stops. We have a custom logger that writes to Custom.log for this import. It writes a message that it is starting the import; that it is making each API call (for each product type); each product ID that is successfully imported or that fails; a message that it has completed importing; and some logging during the publishing. The thing is that the logs just end. I never get to this line: _Logger.Info(&quot;ProductsSync: Finished; publishing products&quot;); I'll have thousands of product completion lines logged, and then the log just ends. There's no error; if there was, I would get this line in the logs, but there's no errors in Custom.log, or in log.txt _Logger.Error(String.Format(&quot;Error on ExecuteProductSync &quot;) + ex.Message); Below is a picture showing how the logs just stop abruptly So I expect the issue is that the app is recycling or going to sleep or something, and this is aborting the scheduled task. I do have keepalive in my CM instance: <agent type=&quot;Sitecore.Tasks.UrlAgent&quot; method=&quot;Run&quot; interval=&quot;00:15:00&quot;> <param desc=&quot;url&quot;>/sitecore/service/keepalive.aspx</param> <LogActivity>true</LogActivity> </agent> so why would it be stopping/restarting, and how can I prevent it from doing so while the task is running?
You don't mention your specific Sitecore version nor Unicorn version. But in the right set of circumstances, e.g. a Sitecore 10.x and a Unicorn version below 4.1.5, you could definitely run into publishing problems due to API changes in Sitecore. Unicorn release 4.1.6 should solve your problems. https://github.com/SitecoreUnicorn/Unicorn/releases/tag/4.1.6 Related issue: https://github.com/SitecoreUnicorn/Unicorn/issues/407
Patch to Publishing DB's doesnt seem to work So I have my unicorn autopublish file below and the patch I added to it. I still seem to have trouble with the files actually getting published to the databases for web_uk and web_west. Just wondering if I need anything else on my patch file or if I should look into the unicorn upgrade as a possibility of not getting all the files up correctly. <unicornSyncEnd> <!-- when all configurations have synced, fire off a publish that processes the queue we've accumulated --> <processor type=&quot;Unicorn.Pipelines.UnicornSyncEnd.TriggerAutoPublishSyncedItems, Unicorn&quot;> <PublishTriggerItemId>/sitecore/templates/Common/Folder</PublishTriggerItemId> <!-- the trigger item can be any leaf node Sitecore item - just has to have a 'starting point' for the publish --> <!-- these are the database(s) to publish synced items to --> <TargetDatabases hint=&quot;list:AddTargetDatabase&quot;> <web>web</web> </TargetDatabases> </processor> </unicornSyncEnd> PATCH FOR THIS FILE <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:environment=&quot;http://www.sitecore.net/xmlconfig/environment/&quot;> <sitecore> <unicorn patch:source=&quot;Sitecore.Unicorn.AutoPublish.config&quot;> <TargetDatabases hint=&quot;list:AddTargetDatabase&quot; environment:require=&quot;prodcm or prodcd&quot;> <web_west>web_west</web_west> <web_uk>web_uk</web_uk> </TargetDatabases> </unicorn> </sitecore> </configuration>
This is not JSS specific but we used this approach in a JSS project. To ignore the region on the item language version, we changed the language item name and the values of specific fields like Regional Iso Code in the master DB. But then we also had to migrate all the items language field. This change caused some problems with resolving for example the Display Name or Title field, because the language of the field template has to be with region (that's how Sitecore works, there is no option to change this behavior in the language settings). But the solution for that was to only create the field template in the specific language with region.
In multilingual site, how to ignore region for sc_lang param in jss layout api and get the appropriate language content By default, to get a specific language content, we need to pass the query params for sc_lang as es-MX, fr-FR..ETC (sc_lang=&quot;es-MX&quot;) in the JSS layout API to get the specific lang contents. Is there any way to ignore the region and only send the language like sc_lang=&quot;es&quot; https://scdev9.3cm.dev.local/sitecore/api/layout/render/jss?item={8AFD4EBE-1072-4E86-8C33-7F7C8780C36A}&amp;**sc_lang=es**&amp;sc_apikey={03FCC368-DDA2-4B5F-95AB-5DCF35245E16}
There are a few ways to handle this solution: Static html (requires Content Editor). Static html with JavaScript to update the year. Scriban template to calculate the year on render. NVelocity could be used but is no longer available with SXA. For now we'll focus on 2 and 3. Static html with JavaScript Add a Rich Text or Plain HTML rendering to the Partial Design for your footer with the following text: <div class=&quot;copyright&quot;></div> Add a script to your theme with something like this: (function ($) { 'use strict'; $(function () { var theDate=new Date(); var year = theDate.getFullYear(); $('.copyright').append(&quot;<p>©&quot; + year + &quot; Michael West, Inc. All rights reserved.</p>&quot;); }); })(jQuery); Scriban template Add a new Scriban template to whichever component you want with the following text: <p>&amp;copy; {{ date.now.year }} Michael West, Inc. All rights reserved.</p>
How do you create a dynamic copyright year in the footer using SXA? I'm looking to build a new site and want to make the copyright something Content Editors do not have to worry about. Is there a way in SXA to automate the year?
Below are points I have tried: Run clean.ps1 inside docker\clear.ps1 Deleted my docker containers Again run this command .\Start-Environment -LicensePath &quot;C:\path\to\license.xml&quot; Still I was getting the same error Then I run .\Start-Environment.ps1 -InitializeEnvFile again and again, I think 2-3 times then after that Sitecore-MVP site has been set up successfully.
Setup Sitecore MVP website in Sitecore 10.2 I am trying to set up MVP-Site website in Sitecore 10.2 with Docker from this Github url https://github.com/Sitecore/MVP-Site/tree/feature/start-env-script and I am facing the below issue:
This looks a bug in sc 10 (seems to be an issue in sc 10.1 as well) Details: Interaction with form fields makes an async post call to /fieldtracking/register, by inspecting the FieldTrackingController, you shall notice the Register Action method makes an explicit call to _formEventsTracker.RegisterEvent (this call is triggered when form fields performance tracking is enabled from forms editor ). This makes an internal call to AnalyticsTrackerResolver.CurrentPage -> Code below public ICurrentPageContext CurrentPage { get { if (!Tracker.Enabled) return (ICurrentPageContext) null; if (Tracker.Current == null) AnalyticsTrackerResolver.StartTracking(); return Tracker.Current?.Session?.Interaction?.CurrentPage; } } You may notice this is missing a condition check to check whether User Consent has been granted before starting tracking. Workaround: Yet to to raise a bug with sitecore until then you may have the workaround I have which worked well for me: Add a custom AnalyticsTrackerResolver (ServiceConfigurator) with following additional check to return null if cannot start tracking until user consent has been given (from Consent Manager) !if (!ServiceLocator.ServiceProvider.GetRequiredService<IConsentManager>().CanStartTracking) return (ICurrentPageContext)null; Complete Code: public ICurrentPageContext CurrentPage { get { if (!Tracker.Enabled) return (ICurrentPageContext)null; if (!if (!ServiceLocator.ServiceProvider.GetRequiredService<IConsentManager>().CanStartTracking)) return (ICurrentPageContext)null; if (Tracker.Current == null) xDbAnalyticsTrackerResolver.StartTracking(); return Tracker.Current?.Session?.Interaction?.CurrentPage; } }
Sitecore Forms starts tracking (analytics) despite explicit consent for tracking has been set true for a site Environment: SXA 10x, Azure PaaS I have configured the SXA site to require explicit tracking consent by adding this setting to site properties explicitConsentForTrackingIsRequired = &quot;true&quot;. The tracking is disabled with this until consent is given however only when I browse or interact with a Sitecore form say updated the Input text field and changed focus I noticed that the tracking has been already started which does not obey the consent manager. Could someone help let me know if I missed any configuration here ?
There are 2 different parts to this questions: Updating the Sitecore config at runtime is possible but hard, see this post for more details. However: I don't believe succeeding in task 1 will actually help you. The OWIN middleware used by FederatedAuthentication gets registered when the Application Pool starts. The middleware is already registered if you change the setting at runtime later. This middleware cannot be removed later see this. I would suggest looking into one of below approaches: If the main goal is about preventing a long lived branch, then perhaps you merge and delete this branch but keep Owin.Authentication.Enabled disabled until you are ready to introduce this change (which will require a deployment)? If above option does not work for your scenario, then you could look into the approach which is also linked here about wrapping the execution of the middleware with a condition. This might require a lot of customizations to Sitecore as some of the middleware is registered by Sitecore.
Enabling federated authentication using a feature flag in Code We have managed to configure our Auth0 custom identity provider in our solution. Migrating from forms authentication however will take a bit more effort than just a bunch of config. In order to avoid a really long lived branch, would there be a possibility to switch federated security on/off using a feature switch service like Launch Darkly. Example of config: <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot; xmlns:set=&quot;http://www.sitecore.net/xmlconfig/set/&quot;> <!-- This configuration disables Owin and Federated Auth which prevents Sitecore Membership Provider from allow website visitors to authenticate and maintain a authenticated session. This only applies to Standalone used for local dev and ContentDelivery for public website. The CMS will still use Sitecore Identity Server to Authenticate. --> <sitecore role:require=&quot;Standalone or ContentDelivery&quot;> <settings> <setting name=&quot;Owin.Authentication.Enabled&quot; value=&quot;false&quot; /> <setting name=&quot;FederatedAuthentication.Enabled&quot; value=&quot;false&quot; /> </settings> <sites> <site name=&quot;shell&quot; set:loginPage=&quot;/sitecore/login&quot; /> <site name=&quot;admin&quot; set:loginPage=&quot;/sitecore/admin/login.aspx&quot; /> </sites> </sitecore> </configuration> Where the flags like Owin.Authentication.Enabled can be switched on to True at runtime by fetching this from another service.
You can use Sitecore.Context.Language to get the context language of the website. In your case, you can use something like this: <div> <p>The language you are using</p> <p>@Sitecore.Context.Language</p> </div>
How to display English (region) language code on some of the pages? How to get the English (region) - English (region) language code from Sitecore? I want to display the language code (EN for example) on some of the pages inside the <div> tag for example <div> <p>The language you are using</p> <p>[Display language code - EN here]</p> </div> I know I can just type myself the EN in the <p> tag, but I want to do it dynamically to just show this <p> tag when user is on English (region) - English (region) version of the site
You can go with the Sitecore eLearning website for Sitecore 10 Certification material and details. There you will find the Sitecore 10 .NET Developer Certification Exam. Prerequisites This exam is intended for developers. We recommend you meet the following prerequisites before taking the Sitecore 10 .NET Developers Certification Exam: At least one year of prior experience developing on the Sitecore XP solution. Complete Learning@Sitecore’s Developer’s Fundamentals 9.3 Collection. Complete Learning@Sitecore’s Developer’s Fundamentals 10 Collection. Complete Learning@Sitecore’s Sitecore Experience Solution Developer 9.1 Instructor-Led Training To pass the Sitecore 10 .NET Developer Certification Exam, you will also need to be proficient in the exam competencies. We recommend you prepare by participating in Learning@Sitecore training opportunities, enrolling in, and completing our free study guide, reviewing Sitecore’s developer documentation, and speaking with others within the Sitecore development community at large. Exam competencies To be certified in Sitecore 10 .NET Developer you are expected to have fundamental knowledge, skills, and abilities in seven distinct areas, known as competencies: Competency 1: Sitecore structure &amp; platform (12%) Competency 2: Security &amp; user management (16%) Competency 3: Item management (20%) Competency 4: Layout &amp; placeholders (10%) Competency 5: Components, controls, &amp; renderings (26%) Competency 6: Sitecore Content Serialization (10%) Competency 7: Containers (6%) You can also refer below links and youtube video for more insight: Sitecore 10 Certification Tips and Tricks Sitecore 10 .NET Developer Certification Sitecore 10 Certification Crash Course I would personally suggest that you complete the course Developer's Fundamentals 10 Collection from the Sitecore e-learning Portal. It will make you a better understanding of competencies points 5, 6, and 7 mentioned above.
How to get Sitecore 10 certification material? I am totally new to Sitecore and would like to get study material for the certification. Could someone assist me with this?
The form.tracking.js script that ships with Sitecore triggers a POST request on blur of a field if the field has changed. The server-side handler code then checks if (HttpContext.Session.IsNewSession) { return content with &quot;Your session has expired. Please refresh this page.&quot; } the client-side js will then show that message as an alert. The page likely will need to be refreshed because a new session has started, and therefore the CSRF token will be invalid and the user will get an error trying to submit the form. In this case if you started a new browser session, the Sitecore robot detection needs to run. If it didn't classify you as human yet, then after some time the session will time out. The default timeout set on Analytics.Robots.SessionTimeout is 1 minute, so this fits the short time frame you're mentioning.
Forms message - Your session has expired. Please refresh this page I started a new browser session, navigated straight to a page with a form on it, then left the page open for a few minutes, when I started filling the form I received a window alert with Your session has expired. Please refresh this page. Why have I received this and why does the page need to be refreshed?
I managed to bypass these limits by using Regex: ^VIEW|ADD|CHECKOUT|IDENTITY$. After trying many regex variations, I noticed that it only works with ^...$ format:
Sitecore CDP triggered experience. Trigger limitations I have faced an issue with triggered experience: I need to have 4 events as a trigger (ADD, VIEW, CHECKOUT, IDENTITY). It works fine for any 3 events combination, but for 4 events server returns an error: Error updating triggers ERROR: value too long for type character varying(255) It looks like database field or backend model limitation on server side. Any suggestions/workarounds?
xConnect Search does not support Contains extension method as you rightly identified, you may fetch the contacts in batches using GetBatchEnumerator and iterate through contacts until you find the match for the Keyword (avoid skip as skipping large results proves to be inefficient as per documentation). Sample code with GetBatchEnumerator: (you may edit batch size depending on your contact capacity) if (string.IsNullOrWhiteSpace(searchTerm)) { return null; } var batch = await client.Contacts.WithExpandOptions(expandOptions) .GetBatchEnumerator(); List<Contact> matchedContacts = new List<Contact>(); try { while (await batch.MoveNext(200, token)) { var contacts = batch.Current; foreach (var contact in contacts) { var preferredPhoneNumber = contact.GetFacet<PhoneNumberList>(Sitecore.XConnect.Collection.Model.CollectionModel.FacetKeys.PhoneNumberList).PreferredPhoneNumber.Number; var preferredEmail = contact.GetFacet<EmailAddressList>(Sitecore.XConnect.Collection.Model.CollectionModel.FacetKeys.EmailAddressList).PreferredEmail.SmtpAddress; if(preferredPhoneNumber.Contains(searchTerm) || preferredEmail.Contains(searchTerm)) { matchedContacts.Add(contact);//Optimize: you may return on first match unless you want to gather all contacts. } } if (token.IsCancellationRequested) { break; } } } catch (OperationCanceledException) { } TIP: In order to further curate the contacts before the keyword filter ensure to use any other conditions(using Where) which may help bring down the batch size.(Ex TimeSpan, Recent interactions etc. based on your requirements) Hope it helps !!
How to implementing keyword search with xconnect contact facet search? I am using Sitecore 10 and trying to implement keyword search with xConnect contact. I want to search for contacts that have email or phone number that contains the inputted keyword. Below is my approach. var expandOptions = new ContactExpandOptions(EmailAddressList.DefaultFacetKey, ListSubscriptions.DefaultFacetKey, PersonalInformation.DefaultFacetKey, PhoneNumberList.DefaultFacetKey); IAsyncQueryable<Sitecore.XConnect.Contact> queryable; if (!string.IsNullOrWhiteSpace(searchTerm)) { queryable = client.Contacts.WithExpandOptions(expandOptions).Where(c => c.GetFacet<PhoneNumberList>(CollectionModel.FacetKeys.PhoneNumberList).PreferredPhoneNumber.Number.Contains(searchTerm) || c.GetFacet<EmailAddressList>(CollectionModel.FacetKeys.EmailAddressList).PreferredEmail.SmtpAddress.Contains(searchTerm)) .Skip((page - 1) * pageSize) .Take(pageSize); } The problem is when this function is executed, it throws the exception: YourLinqIsTooStrongException Turn out the xConnect search does not implement all of IAsyncQueryable methods and Contains() method is not supported as mentioned in this official document: https://doc.sitecore.com/xp/en/developers/92/sitecore-experience-platform/supported-methods-and-operators-for-xconnect-search.html I've enabled indexing of PII sensitive data. Has anybody encountered this error before and do you know how to resolve it?
You can get the rendering parameters value in the view as well as in the controller. Try to use the below code in the view @{ string name=&quot;&quot; var renderingContext = Sitecore.Mvc.Presentation.RenderingContext.CurrentOrNull; if (renderingContext != null) { var parms = renderingContext.Rendering.Parameters; name= parms[&quot;name of the field here&quot;]; } } In the controller, you can use the below code : var addtionalCssParameter = RenderingContext.Current.Rendering.Parameters[&quot;name of the field&quot;]; Both approach will work in SXA. If you will get an issue in SXA then you can try this code in the view. @{ string name= Convert.ToString(Model.Rendering.Parameters[&quot;name of the field&quot;]); }
How to get the value from rendering parameters from VariantListsRenderingModel? How to get the value from this type of model in the code. I have a simple carousel and I can get values easily from fields now I just want to get the Rendering Parameters for this specific rendering. Is that possible to do if the model is VariantListsRenderingModel? This is what I mean by this:`
After some more research I found the following PR: https://github.com/Sitecore/jss/pull/808 It seems this was a bug and fixed in JSS 19.0.0. If you're on an older version you should update your setupProxy.js to this: // when in connected mode we want to proxy Sitecore paths // off to Sitecore app.use(proxy('/sitecore', { target: config.sitecoreApiHost, changeOrigin: true })); // media items app.use(proxy('/-', { target: config.sitecoreApiHost, changeOrigin: true })); // visitor identification app.use(proxy('/layouts', { target: config.sitecoreApiHost, changeOrigin: true })); After this the request worked instead of a 404:
Sitecore requests give a 404 in connected mode I'm using Sitecore 10.1 with JSS 16.0.0. In connected mode when I visit a Sitecore path, it gives a 404 error. For example:- http://localhost:3000/sitecore/api/layout/render/jss?item=%2F&amp;sc_lang=en&amp;sc_apikey=%3D4F3181-E8CF-49E9-9783-00605AF39941%7D Based on setupProxy.js, it should be proxied: app.use(proxy('/sitecore', { target: config.sitecoreApiHost })); Does anybody know how I can fix this?
I have updated the detailed answer here, please find it here Sxa custom search token query Wrong date format
SXA seach Scope is not returning result in Search result component I just added conditions in the search scope. I could see the result in the backend, but the same is not returning the search result component. If I remove the date condition, it is returning the result. Note: Event_end_date_s field is the computed field, i just created for filtering.
Instead of placeholder, just need to DynamicPlaceholder like below - @Html.Sitecore().DynamicPlaceholder(&quot;key&quot;) No need to give *, this DynamicPlaceholder will manage a unique by itself like below -
How to add dynamic placeholder to a SXA Rendering Variant? Is there any way for me to add placeholders programatically inside the SXA rendering variant. I have tried using the * at the end of the name of placeholders but I keep getting some weird errors and the whole site just crashes. Here is what I mean by this: const string key = &quot;carousel-1-*&quot; @Html.Sitecore().Placeholder(key) I keep getting erros when I use this. Also, the model is VariantListsRenderingModel
Check your showconfig.aspx and let me know if its DEFAULT or YML
Error - Sitecore is configured for item serialization but it's creating YAML files I'm using Sitecore 9.3 and when I try to serialize an item by Developer > Serialize Tree, the item generated always has the extension &quot;.yaml&quot;. However, I'd like the extension &quot;.item&quot;. I've set up the Serialization Type at file &quot;Sitecore.Serialization.config&quot;, but didn't work. Is there anything more that I need to do? Could someone help me, please? Thank you!
After adding the captcha script above script, as shown in image Removing an async keyword from validation referencing script of captcha It works for me. Thanks
Sitecore Forms Captcha Validation Message showing intermittently we are using Sitecore forms with Captcha for forms validation. If we are doing a hard refresh (first-time load), It will not show a validation message for captcha. If we refresh the page a second time, it will load, and on submit button, the captcha validation message is showing. We are using Sitecore 9.3 with a multilingual website and passing the language with the script of captcha as shown below.
I have resolved the issue. I would like to add my answer here My computed field config <field fieldName=&quot;event_start_date&quot; sourceField=&quot;StartDate&quot; returnType=&quot;string&quot;>Foundation.Search.ComputedFields.DateFieldComputedField, Foundation.Search</field> <field fieldName=&quot;event_end_date&quot; sourceField=&quot;EndDate&quot; returnType=&quot;string&quot;>Foundation.Search.ComputedFields.DateFieldComputedField, Foundation.Search</field> Computed field logic public object ComputeFieldValue(IIndexable indexable) { var indexableItem = indexable as SitecoreIndexableItem; if (indexableItem == null) return null; if (string.IsNullOrEmpty(SourceField)) return null; var field = indexableItem.Item.Fields[SourceField]; if (field == null) return null; return Getvalue(field); } private DateTime Getvalue(Field fieldValue) { DateTime serverTime = DateUtil.IsoDateToDateTime(fieldValue.Value, DateTime.MinValue); return DateUtil.ToUniversalTime(serverTime); } SXA Token logic public class ExcludePastEvents : ResolveSearchQueryTokensProcessor { protected string TokenPart { get; } = &quot;ExcludeItemWithPreviousDateInDateField&quot;; private readonly string DateCompareIdentifier = &quot;#datecompare#&quot;; [SxaTokenKey] protected override string TokenKey => FormattableString.Invariant(FormattableStringFactory.Create(&quot;{0}|FieldName&quot;, (object)this.TokenPart)); public override void Process(ResolveSearchQueryTokensEventArgs args) { if (args.ContextItem == null) { return; } for (int index = 0; index < args.Models.Count; index++) { SearchStringModel model = args.Models[index]; if (model.Type.Equals(&quot;sxa&quot;) &amp;&amp; ContainsToken(model)) { string fieldName = model.Value.Replace(TokenPart, string.Empty).TrimStart('|'); args.Models.Insert(index, this.BuildModel(fieldName)); args.Models.Remove(model); } } } protected virtual SearchStringModel BuildModel(string fieldName) { try { Assert.ArgumentNotNull(fieldName, &quot;fieldName&quot;); string fieldFormat = &quot;yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'&quot;; DateTime dateTime = DateUtil.ToUniversalTime(DateTime.UtcNow); string formatedDate = string.Format(arg1: &quot;*&quot;, format: &quot;{2}[{0} TO {1}]&quot;, arg0: dateTime.ToString(fieldFormat), arg2: DateCompareIdentifier); return new SearchStringModel(&quot;custom&quot;, FormattableString.Invariant(FormattableStringFactory.Create(&quot;{0}|{1}&quot;, (object)fieldName.ToLowerInvariant(), formatedDate))) { Operation = &quot;must&quot; }; } catch (Exception ex) { Log.Info(string.Format(&quot;BuildModel - error-{0}stacktrace{1}&quot;, ex.Message.ToString(), ex.StackTrace.ToString()), ex); } return new SearchStringModel(); } protected override bool ContainsToken(SearchStringModel m) { return Regex.Match(m.Value, FormattableString.Invariant($&quot;{TokenPart}\\|[a-zA-Z ]*&quot;)).Success; } }
Sxa custom search token query Wrong date format I have added a new sxa token processor to filter the passed date events, This is my Code protected virtual SearchStringModel BuildModel(string fieldName) { Log.Info($&quot;SXA_Token customSearchModel: {new SearchStringModel(&quot;custom&quot;, FormattableString.Invariant(FormattableStringFactory.Create(&quot;{0}|{1}&quot;, (object)fieldName.ToLowerInvariant(), $&quot;[{DateTime.Today.ToUniversalTime().ToString(&quot;yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'&quot;)} TO *]&quot;)))}&quot;, &quot;SXA_Token&quot;); return new SearchStringModel(&quot;custom&quot;, FormattableString.Invariant(FormattableStringFactory.Create(&quot;{0}|{1}&quot;, (object)fieldName.ToLowerInvariant(), (object)$&quot;[{DateTime.Today.ToUniversalTime().ToString(&quot;yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'&quot;)} TO *]&quot;))) { Operation = &quot;must&quot; }; } This is my Solr Query INFO Solr Query - ?q=((event_end_date_s:(\[2022\-03\-10T18\:30\:00.000Z\ TO\ *\]) Expected solr Query format event_end_date_s:[2022-03-10T18:30:00.000Z TO *] How should I format my date and need to remove \? I just tried to remove ' from my code, still no luck
Looks like on Azure PaaS, icons are not accessible / visible via /temp/iconcache/ path. You need to use /~/icon/ instead in your path to get icons. This works both locally and also on server to get icons.
Field guids shown in Edit Frame instead of edit button We can see a list of field guids on Edit Frame on other environments to local dev like this: All is working fine locally: Image is not available in iconcache: Looks like the problem is only with Azure PaaS. Has somebody solved this?
Use the below code for showing Title value in the page if you are using it under head tag: Html.Sitecore().Field(&quot;Field Name&quot;, new { DisableWebEdit = true })
How to fix weird bug with <option> tag in Experience Editor? Does anyone get this weird issue when you are using <select> input tag, and inside the selec tag the the <option> tag. Everything works perfectly fine in Preview Mode but inside the Experience Editor it shows something really weird. Here is the image to show you what I mean by this: Console View in Experience Editor
No, it is not possible. You can check the official list of all Sitecore images here. If you need another SQL server version image, you need to build that image by yourself.
Is there any way to specify SQL server version in mssql image? scr.sitecore.com/sxp/sitecore-xp1-mssql:10.0.1-ltsc2019 image is installing SQL server -v 2014. Is there any way to specify version 2016 or different image tag which will install 2016 ?
To update the General Link field named GeneralLinkField in the /Sitecore/Content/Home item in the Master database to the anchor namedAnchor: Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase(&quot;master&quot;); Sitecore.Data.Items.Item home = master.GetItem(&quot;/sitecore/content/home&quot;); Sitecore.Data.Fields.LinkField linkField = home.Fields[&quot;generallinkfield&quot;]; home.Editing.BeginEdit(); linkField.Clear(); linkField.LinkType = &quot;anchor&quot;; linkField.Url = &quot;namedAnchor&quot;; home.Editing.EndEdit(); You can also check the link type and perform the functionality as required: switch (generalLinkfield.LinkType.ToLower()) { case &quot;internal&quot;: return generalLinkfield.TargetItem != null ? Sitecore.Links.LinkManager.GetItemUrl(generalLinkfield.TargetItem) : string.Empty; case &quot;media&quot;: return generalLinkfield.TargetItem != null ? Sitecore.Resources.Media.MediaManager.GetMediaUrl(generalLinkfield.TargetItem) : string.Empty; case &quot;external&quot;: return generalLinkfield.Url; case &quot;anchor&quot;: return !string.IsNullOrEmpty(generalLinkfield.Anchor) ? &quot;#&quot; + generalLinkfield.Anchor : string.Empty; case &quot;mailto&quot;: return generalLinkfield.Url; case &quot;javascript&quot;: return generalLinkfield.Url; default: return generalLinkfield.Url; } for more details please refer Access general link fields
How to create an anchor tag of General Link field We are getting results through Content Search API and getting the General Link field value into it. We would like to add an anchor link based on a general link field value. Do we have the default feature of Sitecore to create an anchor link in view or do we need to use custom code to create a link?
Please follow steps below and i hope this resolve your issue : Step 1 – Create a Self-signed certificate Run Windows Powershell as Administrator Type the follow command, then hit enter New-SelfSignedCertificate -DnsName mydomain.com -CertStoreLocation cert:\LocalMachine\My Step 2 – Use Self-Signed Certificate on IIS Open IIS, expand sites Select the Site you want to use Self-Signed certificate, right-click on it then Edit Bindings In Site Bindings, click Add In Add Site Binding, choose Type HTTPS and on SSL certificate choose the certificate create in Step 1, and click Ok then Close (Site Bindings window) Create a password using the following command $sslPassword = ConvertTo-SecureString &quot;P@ssw0rd&quot; -Force -AsPlainText Export the certificate as PFX file using the command below Export-PfxCertificate -Cert cert:\LocalMachine\My\AB34CF46EF6DAAE6FCB69C65F4A9C07710644F3F -FilePath C:\temp\mydomain.pfx -Password $sslPassword Navigate to the folder you saved the PFX file and check if it was created. In my case, it was on C:\temp Import Certificat Please find the complete post with all the details below : https://viniciusdeschamps.com.br/sitecore-using-ssl-part-1/
Local sitecore instance SSL certs expired Sorry, this seems more simple than I am making it to be but I am just running into multiple errors after reading and trying multiple articles. So after my initial installation of Sitecore, my certs have expired, I have tried creating just one self-assigned cert and then assigning it to my site app pool, which will allow my site to run even though I still get the site isn't secure and passes it on to the unsafe site, however when I try to get to my local Sitecore tree I can NOT get my login page to load up with these certs. I just get the below error. HTTP Error 403.16 - Forbidden Your client certificate is either not trusted or is invalid. I don't know if I need to update the identity server, xconnect, and reg app pool with the new cert and then update all the thumbprints or what I need to really do. None of the articles really hit my points, trying to look for help to have the exact walk-through I need. So unsure about thumbprints and if I need to delete the other expired certs, etc.
It looks like an update to Identity Server in an updated release of XP has introduced compatibility issues with the generated Sitecore.Commerce.IdentityServer.Host.xml in the XC installation, i.e. it appears api scopes are more granularly defined now. Please review Sitecore Experience Commerce 10.0 and 10.1 Compatibility Update for Sitecore XP Identity Server to see if this resolves the issue.
"Invalid scope" error when accessing Business Tools on Sitecore 10.1 I've installed Sitecore 10.1 and, on top of it, Sitecore Commerce. I finished the installation, and when accessing Business Tools from the Launchpad, it shows up for a moment, and then I'm redirected to the IdendityServer login page, but with this error: This is what is being logged: 2022-03-16T14:10:08.7965050-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Request starting HTTP/1.1 GET http://***-identityserver.dev.local/connect/authorize?response_type=id_token%20token&amp;client_id=CommerceBusinessTools&amp;redirect_uri=https://bizfx.sc.com&amp;scope=openid%20EngineAPI&amp;nonce=N0.31280724757091851647450608520&amp;state=16474506085200.9484341272330379 2022-03-16T14:10:08.8290746-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Invoking IdentityServer endpoint: &quot;IdentityServer4.Endpoints.AuthorizeEndpoint&quot; for &quot;/connect/authorize&quot; 2022-03-16T14:10:08.8341253-03:00 [ERR] (Sitecore Identity/DPCLUCASVB) Scope &quot;EngineAPI&quot; not found in store. 2022-03-16T14:10:08.8345267-03:00 [ERR] (Sitecore Identity/DPCLUCASVB) Request validation failed 2022-03-16T14:10:08.8376966-03:00 [INF] (Sitecore Identity/DPCLUCASVB) AuthorizeRequestValidationLog { ClientId: &quot;CommerceBusinessTools&quot;, ClientName: &quot;CommerceBusinessTools&quot;, RedirectUri: &quot;https://bizfx.sc.com&quot;, AllowedRedirectUris: [&quot;{AllowedCorsOrigin}&quot;], SubjectId: &quot;b4af4fc7aba7412794519f0e01df44b6&quot;, ResponseType: &quot;id_token token&quot;, ResponseMode: &quot;fragment&quot;, GrantType: &quot;implicit&quot;, RequestedScopes: &quot;openid EngineAPI&quot;, State: &quot;16474506085200.9484341272330379&quot;, UiLocales: null, Nonce: null, AuthenticationContextReferenceClasses: null, DisplayMode: null, PromptMode: &quot;&quot;, MaxAge: null, LoginHint: null, SessionId: null, Raw: [(&quot;response_type&quot;: &quot;id_token token&quot;), (&quot;client_id&quot;: &quot;CommerceBusinessTools&quot;), (&quot;redirect_uri&quot;: &quot;https://bizfx.sc.com&quot;), (&quot;scope&quot;: &quot;openid EngineAPI&quot;), (&quot;nonce&quot;: &quot;N0.31280724757091851647450608520&quot;), (&quot;state&quot;: &quot;16474506085200.9484341272330379&quot;)] } 2022-03-16T14:10:08.8430948-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Request finished in 47.8665ms 302 2022-03-16T14:10:08.9316137-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Request starting HTTP/1.1 GET http://***-identityserver.dev.local/home/error?errorId=CfDJ8GTT_qDgI1VAkWOBM_vsScAFLGffMZ3QmoiYrnOODR9yFUp5BpAg_lDQ9y9tbVxSs4EHrE1t1KMU4i45q1lfZeXALjwIaqprI43xIj6HBQiCar3o8nprKpWkg5iRMxp-M2LnviJIuvgQqd8dVjvRcYp6TzwQfpMzGC9FaExKrhDSKg7WKJB6u8NWt6S-N6env90H-sxMDrR4hZ0K3S_eIqerhwHCWCo0suD4IGqMqZw7jVC7z44l_mB2BFNOpwl6Dx3_oR8AmgngY_Ljqph_i3AQC52n1u911lmP9YFB_7W4oMzUjBHModwJA3n5KvO6Kx2srN3LO6DxMBmgMG2x7W6i0iOa-PlnrCxWYhMOAqJjzghhPtKjVkdKy52bNsJp0nKg44U7PK4RC6V6CjBsulrotknfZMr5k3sWEh_UeHtEuVIpsYjN3xHdZubWUgl90CiHxTanJUOheBRdPwYAiP8z93-GBDRLyYQCubezNUejToB08-V1xMr33FZudr9BeIxL1SZ4vDzIjP9ydCl8TaHcgCS6sje9VADPCcDiIpNd 2022-03-16T14:10:08.9342213-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Executing endpoint '&quot;Sitecore.Plugin.IdentityServer.Controllers.HomeController.Error (Sitecore.Plugin.IdentityServer)&quot;' 2022-03-16T14:10:08.9368169-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Route matched with &quot;{action = \&quot;Error\&quot;, controller = \&quot;Home\&quot;}&quot;. Executing controller action with signature &quot;System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Error(System.String)&quot; on controller &quot;Sitecore.Plugin.IdentityServer.Controllers.HomeController&quot; (&quot;Sitecore.Plugin.IdentityServer&quot;). 2022-03-16T14:10:08.9496793-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Executing ViewResult, running view &quot;Error&quot;. 2022-03-16T14:10:09.0077961-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Executed ViewResult - view &quot;Error&quot; executed in 60.2025ms. 2022-03-16T14:10:09.0082747-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Executed action &quot;Sitecore.Plugin.IdentityServer.Controllers.HomeController.Error (Sitecore.Plugin.IdentityServer)&quot; in 71.0863ms 2022-03-16T14:10:09.0089267-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Executed endpoint '&quot;Sitecore.Plugin.IdentityServer.Controllers.HomeController.Error (Sitecore.Plugin.IdentityServer)&quot;' 2022-03-16T14:10:09.0095339-03:00 [INF] (Sitecore Identity/DPCLUCASVB) Request finished in 78.0566ms 200 text/html; charset=utf-8 The 3rd line states Scope &quot;EngineAPI&quot; not found in store, but on my Config/production/Sitecore.Commerce.IdentityServer.Host.xml, I can see it exists there (<AllowedScope7>): <AllowedScopes> <AllowedScope1>openid</AllowedScope1> <AllowedScope2>dataEventRecords</AllowedScope2> <AllowedScope3>dataeventrecordsscope</AllowedScope3> <AllowedScope4>securedFiles</AllowedScope4> <AllowedScope5>securedfilesscope</AllowedScope5> <AllowedScope6>role</AllowedScope6> <AllowedScope7>EngineAPI</AllowedScope7> </AllowedScopes> Any thoughts on how to solve this?
As mentioned in the answer from Sumit you can have a TreeList in the template that has its source in the media folder so you can select images or videos. To fetch this data you can use Scriban. Take a look at https://doc.sitecore.com/xp/en/developers/sxa/102/sitecore-experience-accelerator/the-embedded-functions-for-the-scriban-template.html for the available extensions. You will need sc_followmany to loop through the selected items (images) from the TreeList. And for each of those (media)items you can use sc_medialink to get the media url. This will be something like: {{ for i_image in (sc_followmany i_datasource &quot;Images&quot;) }} <img src=&quot;{{ sc_medialink i_image }}&quot;/> {{ end }} ps: didn't test the Scriban code, just combined some examples here - so it might be slightly different but it should give you an idea
How to choose image/video from treelist in SXA? Is there a way to make a datasource template that will have a treelist where you can choose the image or video (it can be two seperate treelists) and the display those images or videos in the code (.cshtml file)?
I think you can achieve this something like this. Use Internal Link Field rather than using the Media or Image field. From the Path of the Internal Link get the Video Item and use MediaManager to get the URL. MediaItem video = Sitecore.Context.Database.GetItem(videoPath); string src = Sitecore.Resources.Media.MediaManager.GetMediaUrl(video); You can refer to this link to find more. Video url with Image type Field
How can I display the MP4 General Link Field? I want to display the MP4 video inside the file and I was trying to do it, but I get the issues when I try to display the field inside the component. Here is the template: So is it possible to get the MP4 file from the Media folder and then display it to the component? The name of the field is Video Link. Should I make some new methods or is it easy to do?
Sitecore Horizon is a separate instance. So even if you're logged into Sitecore you still need to login again in Sitecore Horizon. This should be done automatically by SSO with Sitecore Identity. But if there is an issue with your Sitecore Identity environment you might get this error. Could you please visit the URL of your Sitecore Identity environment and check if it works? If it doesn't you need to fix that and after that Sitecore Horizon should work too. I had the same issue where I forgot to update the license file of Sitecore Identity. So all environments worked except Sitecore Identity. Than you will also run into this error.
Horizon "OpenIdConnect" was not authenticated. Failure message: "Not authenticated" I have installed Horizon in Sitecore 10.1. There were no errors in the installation but when opening the horizon URL, I am getting the following errors 2022-03-18T14:41:01.7789590+11:00 [INF] (Sitecore Authoring Host/SYDM18676L) Request finished in 2.3979ms 500 2022-03-18T14:41:08.1615328+11:00 [INF] (Sitecore Authoring Host/SYDM18676L) Request starting HTTP/1.1 GET http://sc101horizon.dev.local/composer/pages 2022-03-18T14:41:08.1617326+11:00 [INF] (Sitecore Authoring Host/SYDM18676L) &quot;OpenIdConnect&quot; was not authenticated. Failure message: &quot;Not authenticated&quot; 2022-03-18T14:41:08.1624277+11:00 [ERR] (Sitecore Authoring Host/SYDM18676L) Connection id &quot;&quot;0HMG8I3VTK6LP&quot;&quot;, Request id &quot;&quot;0HMG8I3VTK6LP:00000004&quot;&quot;: An unhandled exception was thrown by the application. System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden]'. at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel) at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleChallengeAsync(AuthenticationProperties properties) at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.ChallengeAsync(AuthenticationProperties properties) at Microsoft.AspNetCore.Authentication.AuthenticationService.ChallengeAsync(HttpContext context, String scheme, AuthenticationProperties properties) at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Sitecore.Services.GraphQL.Hosting.GraphQLCacheStatsMiddleware.Invoke(HttpContext context) at Sitecore.Horizon.API.Gateway.ConfigureSitecore.<>c__DisplayClass4_0.<<Configure>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Sitecore.Plugin.Authentication.ErrorHandling.AuthenticationExceptionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application) 2022-03-18T14:41:08.1636521+11:00 [INF] (Sitecore Authoring Host/SYDM18676L) Request finished in 2.1186ms 500 Anyone has got the following error and how to fix this? Thanks in advance
Droplist fields always store their values as the name of the items. You should use Droplink instead of Droplist. Getting value in Scriban template <div>This rendering is in the '{{ sc_parameter 'Placeholder' }}' placeholder.<div> Reference : https://doc.sitecore.com/xp/en/developers/sxa/93/sitecore-experience-accelerator/the-embedded-functions-for-the-scriban-template.html Code for getting value without Scriban template : var getValue = RenderingContext.Current.Rendering.Parameters[&quot; name of the field&quot;]; var valueDetails = RenderingContext.Current.ContextItem.Database.GetItem(ID.Parse(Guid.Parse(getValue))); var finalvalue = valueDetails[&quot;Value&quot;];
Scriban Rendering Parameters - how to get the value from Droplist? I am trying to get the value from the Rendering Parameters in Scriban in order to render some new logic. Basically, I want to allow the content editors to choose what colour of the button they will have. I have set up the class names for the colours and everything regarding the frontend part. Now, I only need to get the values from the Droplist since I am using that as a rendering parameters type of datasource. Here is what I mean by this: This is the component properties for this specific component called Sign up section. When user selects for example Gold from the Droplist i want to change the button colour to gold. This is datasource: Here is the template for rendering parameters: And here is the Scriban template: {{ buttonColor = &quot;&quot; if (sc_parameter &quot;Button Color&quot; != null) parameter = sc_parameter 'Button Color' buttonColor = &quot;.button-new-sign {{parameter}}&quot; end backgroundColor = sc_parameter 'Background Color' icon = sc_parameter 'Icon' }} <div class=&quot;call-to-action call-to-action-fullwidth call-to-action-signup&quot; style=&quot;background-color: {{backgroundColor}};&quot;> <div class=&quot;container&quot;> <div class=&quot;call-to-action-content&quot;> <div class=&quot;row flex-md-nowrap justify-content-center&quot;> <div class=&quot;col-12 col-md-auto flex-shrink-1 d-flex flex-column flex-md-row align-items-center justify-content-center&quot;> <svg class=&quot;call-to-action-icon icon icon-email&quot;> <use xlink:href=&quot;#icon-email&quot;></use> </svg> <h2 class=&quot;call-to-action-title text-center text-md-left&quot;> {{sc_field i_item &quot;Sign Up Text&quot;}} </h2> </div> <div class=&quot;col-12 col-md-auto text-center my-auto&quot;> {{ if sc_parameter &quot;Button Color&quot; != &quot;&quot; }} <div class=&quot;call-to-action-button {{buttonColor}}&quot;> {{ sc_beginfield i_item 'Sign Up Link' [['text', ' ']]}} {{ sc_link_text i_item 'Sign Up Link' }} {{ sc_endfield }} </div> {{else}} <div class=&quot;call-to-action-button button button-white&quot;> {{ sc_beginfield i_item 'Sign Up Link' [['text', ' ']]}} {{ sc_link_text i_item 'Sign Up Link' }} {{ sc_endfield }} </div> {{ end }} </div> </div> </div> </div> </div> How to get the Value field from the Colors item, or I can not do that since I am using droplist. Does anyone suggest any other way of doing this?
On each page level under the Navigation section, there will be a checklist field Check to hide navigation filters. This field will give you multiple checkboxes to hide the page from different navigation. - You need to check the Breadcrumb Navigation from this list and after that need to configure your control to set the Navigation Filter to Breadcrumb Navigation - Please ignore the different UI in the screenshot as I am using a browser plugin.
Breadcrumb link customize We are using Sitecore SXA and adding breadcrumb component from the toolbox. It is working fine , however, we need to remove Home link from the breadcrumb: For example : Home > Test > Test Data In the above example , we would like to exclude Home link and the output would be like this : Test > Test Data I have tried breadcrumb default setting property &quot;Start page&quot; but when we select any page, it shows that page on the breadcrumb option on the page only, it is not getting the proper navigation path. My question here is , is there any way to remove Home link in breadcrumb?
First you need to understand how dynamic placeholders are generated in SXA. To learn about it open any view with rendering supporting dynamic placeholders: Views\Container\Container.cshtml You will notice that placeholder key has following format: const string placeholderKeyPrefix = &quot;container&quot;; var key = string.Format(&quot;{0}-{1}&quot;, placeholderKeyPrefix, Model.Id); Which can generate following placeholders: container-1, container-2 Value for Model.Id is taken from rendering parameters (param: DynamicPlaceholderId). This parameters is autogenerated when you drop a rendering on a page. It will start with value 1 or more if there is already rendering of the same type with the same index in rendering parameters. Now, in your case when you add rendering using this line: Add-Rendering -Item $newSitecorePageItem -PlaceHolder &quot;main&quot; -Instance $renderingItem -Parameter @{ &quot;Reset Caching Options&quot; = &quot;1&quot; } -FinalLayout:$useFinalLayout you have to add DynamicPlaceholderId manually. You have to do it because you specified parameters explicitly. If you will leave it empty SXA will autogenerate DynamicPlaceholderId (and defaults for other parameters) for you - but then you have to fetch it anyway because you cannot be sure what's the index used in placeholder. p.s. I am not sure why you are trying to do it this way. Can you describe the challenge you are trying to address? Maybe there are other better ways of solving it.?
Need sample Sitecore PowerShell script to add components to any SXA page dynamically We are looking for a Sitecore PowerShell script using which we can assemble/add components directly to an SXA page. I am able to add an SXA page, then add a Container component (under the page structure) to the page. But now I am not able to understand how to add any component under this Container Component via the same script. $newSitecorePageItem = New-Item -Path $($rootItem.ItemPath) -Name &quot;Demo 1&quot; -ItemType &quot;/sitecore/templates/Project/Website/Page&quot; $renderingPath = &quot;/sitecore/layout/Renderings/Feature/Experience Accelerator/Page Structure/Container&quot; $renderingItem = Get-Item -Database &quot;master&quot; -Path $renderingPath | New-Rendering -Placeholder &quot;main&quot; Add-Rendering -Item $newSitecorePageItem -PlaceHolder &quot;main&quot; -Instance $renderingItem -Parameter @{ &quot;Reset Caching Options&quot; = &quot;1&quot; } -FinalLayout:$useFinalLayout Now suppose I want to add a Splitter Row inside this container and then further add other components into individual rows of Splitter Row i.e Component A to row1 and Component B to row2. What placeholder should I write for these components? Please suggest. Thanks &amp; Many Regards, Lalit Joshi
It seems to me that the message should display meaningful message rather than unexpected json token message. Could you please perform the following steps to make it display the meaningful message: Open the Uploader.js via <sitecore_instance>\sitecore\shell\client\Business Component Library\Layouts\Renderings\Forms\Uploader Find the following upload method: upload: function () Replace the above upload method code with the following: upload: function () { var that = this; this.startUploadTimer(this.datas); this.updateUploadInfo(true, true); //for each files - do the upload _.each(this.datas, function (data) { data.submit().error(function (jqXHR, textStatus, errorThrown) { if (jqXHR.status === 401) { _sc.Helpers.session.unauthorized(); return; } // Triggers error on each model that had an abort if (jqXHR.responseText.indexOf('errorItems') != -1) { var errordata = jqXHR.responseText.split('</html>'); var parsedJson = JSON.parse(errordata[1]); _.each(parsedJson.errorItems[1].Message, function (error) { error.id = data.__id; }); var errors = [{ Message: parsedJson.errorItems[1].Message }]; that.app.trigger(&quot;sc-error&quot;, errors); that.app.trigger(&quot;upload-error&quot;, { id: data.__id, errors: parsedJson.errorItems[1].Message }); return undefined; } else{ if (errorThrown === &quot;abort&quot;) { that.app.trigger(&quot;upload-error&quot;, { id: data.__id }); } else { var errors = [{ Message: errorThrown }]; that.app.trigger(&quot;sc-error&quot;, errors); that.app.trigger(&quot;upload-error&quot;, { id: data.__id, errors: errors }); } } }); }); }, After you perform the above steps, you should be able to see the meaningful message display on the upload media about why the media item is not uploaded successfully.
Media item upload request Is there a way to check if the request is coming from Browse for media files Or is it coming upload file or upload files I have code to check upload image size public class ImageSizeCheck : UploadProcessor { public List<string> RestrictedExtensions { get; set; } public ImageSizeCheck() { RestrictedExtensions = new List<string>(); } public void Process(UploadArgs args) { Assert.ArgumentNotNull((object)args, &quot;args&quot;); if (args.Destination == UploadDestination.File) return; foreach (string index in args.Files) { HttpPostedFile file = args.Files[index]; if (!string.IsNullOrEmpty(file.FileName) &amp;&amp; IsRestrictedExtension(file.FileName)) { if ((long)file.ContentLength > MaxImageSizeInDatabase) { String message = string.Format(&quot;The image {0} can not be uploaded. The maximum size should be {1}.&quot;, file.FileName, MainUtil.FormatSize(MaxImageSizeInDatabase)); args.ErrorText = message; Log.Warn(args.ErrorText, this); message = &quot;\&quot;&quot; + message + &quot;\&quot;&quot;; string str = &quot;<script>alert(&quot; + message + &quot;)</script>&quot;; HttpContext.Current.Response.Write(str); args.AbortPipeline(); break; } } } } private bool IsRestrictedExtension(string filename) { return RestrictedExtensions.Exists(restrictedExtension => string.Equals(restrictedExtension, Path.GetExtension(filename), StringComparison.CurrentCultureIgnoreCase)); } public static long MaxImageSizeInDatabase { get { return Sitecore.Configuration.Settings.GetLongSetting(&quot;Media.MaxImageSizeInDatabase&quot;, 524288000L); } } } The alert is working for UploadFile or UploadFiles but it is giving error for Browse for media files. SyntaxError: Unexpected token < in JSON at position 0 If I find that if the request is coming from Browse for media files then I can skip HttpContext.Current.Response.Write(str); Any suggestion would be appreciated. Thanks in advance.
The Sitecore CLI command that was failing was: dotnet sitecore ser pkg install -n dev -f &quot;C:\deploy\content.itempackage&quot; When I attempted to install the package from my local Sitecore CLI, I was able to reproduce the error and after some additional investigation, the External User Builder was in fact the culprit. Here's what the External User Builder config looked like: <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot;> <sitecore> <federatedAuthentication> <identityProvidersPerSites hint=&quot;list:AddIdentityProvidersPerSites&quot;> <mapEntry name=&quot;all sites&quot; type=&quot;Sitecore.Owin.Authentication.Collections.IdentityProvidersPerSitesMapEntry, Sitecore.Owin.Authentication&quot; resolve=&quot;true&quot;> <sites hint=&quot;list&quot;> <site>regexp:.*</site> </sites> <externalUserBuilder type=&quot;Feature.Authentication.UserBuilders.ActiveDirectoryUserBuilder, Feature.Authentication&quot; resolve=&quot;true&quot;> <IsPersistentUser>true</IsPersistentUser> </externalUserBuilder> </mapEntry> </identityProvidersPerSites> </federatedAuthentication> </sitecore> </configuration> If you look at the <sites> element you can see that there's a regular expression that applies this builder to all of the Sitecore sites: shell, login, admin, service, modules_shell, modules_website, website, etc. This is too heavy-handed, so I updated my configuration to only apply to the admin site: <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot;> <sitecore> <federatedAuthentication> <identityProvidersPerSites hint=&quot;list:AddIdentityProvidersPerSites&quot;> <mapEntry name=&quot;admin site&quot; type=&quot;Sitecore.Owin.Authentication.Collections.IdentityProvidersPerSitesMapEntry, Sitecore.Owin.Authentication&quot; resolve=&quot;true&quot;> <sites hint=&quot;list&quot;> <site>admin</site> </sites> <externalUserBuilder type=&quot;Feature.Authentication.UserBuilders.ActiveDirectoryUserBuilder, Feature.Authentication&quot; resolve=&quot;true&quot;> <IsPersistentUser>true</IsPersistentUser> </externalUserBuilder> </mapEntry> </identityProvidersPerSites> </federatedAuthentication> </sitecore> </configuration> This allowed me to continue using my external user builder appropriately and install my Sitecore Content Serialization package successfully across all environments.
Sitecore CLI 4.1.1 - You are not authorized to perform the task you are attempting Seeing an error with the Sitecore CLI 4.1.1 when pushing items in an Azure DevOps release pipeline: You are not authorized to perform the task you are attempting. You may need to be assigned additional permissions. Troubleshooting completed: Confirmed that the Non-interactive user is configured in Sitecore Identity The Non-interactive account password matches the password being passed by the pipeline Confirmed that requiresUniqueEmail is false for the SQL membership provider in the web.config This was working consistently until an externalUserBuilder was added to ensure human-readable usernames are created with external users. Removing this configuration and re-deploying does not fix the issue. Additional Context: Sitecore 10.2 XM Active Directory authentication is enabled on the Identity Server
You seem to have an old file from Sitecore 9.1.1 which might be Sitecore.Messaging.GatewayService.config. This file does not exist from version 9.2 onward. I suggest that you delete this file and try again. More importantly, you should compare clean Sitecore 10.2 with your current Sitecore upgrade setup and see if there are any files that are from 9.1.1 version. I recommend Kdiff 3 tool where you can choose two directories to compare their contents. Helps a lot to identify what is the difference in their folder contents.
No service for type 'Sitecore.Messaging.GatewayService.GatewayServiceOptions' has been registered I'm migrating the Sitecore 9.1.1 site to Sitecore 10.2 and encountered with below error. Any suggestion to fix this issue is helpful.
front-end - your last element should contain CSS class: last. Use this information to manipulate existing HTML - modify with CSS/JSS back-end - modify view: \Views\Breadcrumb\Breadcrumb.cshtml - i.e render n-1 elements and last (n) separately. content - modify your variant definition. create 2 variations (1. for last element without link, 2. for the rest). Control which variant field version (with link or w/o link) should be used with Rules field.
Remove Breadcrumb last node link We are using the Sitecore SXA Breadcrumb component. It is showing perfectly fine on the page, however the last node (current page) is showing as a link. We don't want to show the last node as link. Could someone assist me on this?
I have tried this and not managed to get the ++ increment variable to work, but a simple index = index + 1 does work. Change your template to this: {{- index = 0 -}} {{~ if i_item.has_children ~}} {{~ for i_child in i_item.children ~}} <div class=&quot;section anchor-header&quot; id=&quot;{{i_child.Anchor.raw}}&quot;> <div class=&quot;container&quot;> <div class=&quot;row&quot;> <div class=&quot;col&quot;> <h2 class=&quot;anchor-header-title&quot;> {{i_child.Name}} </h2> <button type=&quot;button&quot; class=&quot;anchor-header-button anchor-link&quot;> <svg class=&quot;icon icon-arrow&quot; aria-hidden=&quot;true&quot;> <use xlink:href=&quot;#icon-arrow&quot;></use> </svg> TOP </button> </div> </div> </div> </div> {{index = index + 1}} {{sc_placeholder 'section-' + index}} {{~ end ~}} {{~ end ~}} You'll notice too that I've added whitespace control around your loop and if statement, it helps generate cleaner markup in the rendered version. Here is a .netfiddle to prove the template works https://dotnetfiddle.net/B9vgj4 Update It looks like the ++ operator was added in a newer version of Scriban - not sure which version, but if you try the latest (5.4.1 at the time of writing) - your original code works fine. So looks like the version with SXA does not support that.
How to increment value and use it in sc_placeholder Is it possible in Scriban to use the value from the variable, and then increment it and then use that value inside the sc_placeholder If it is not possible using the basic default Scriban, maybe someone knows some extension that I can use with this. This is what I mean by this: {{- index = 0 -}} {{if i_item.has_children}} {{for i_child in i_item.children}} <div class=&quot;section anchor-header&quot; id=&quot;{{i_child.Anchor.raw}}&quot;> <div class=&quot;container&quot;> <div class=&quot;row&quot;> <div class=&quot;col&quot;> <h2 class=&quot;anchor-header-title&quot;> {{i_child.Name}} </h2> <button type=&quot;button&quot; class=&quot;anchor-header-button anchor-link&quot;> <svg class=&quot;icon icon-arrow&quot; aria-hidden=&quot;true&quot;> <use xlink:href=&quot;#icon-arrow&quot;></use> </svg> TOP </button> </div> </div> </div> </div> {{index++}} {{sc_placeholder 'section-{{index}}' }} {{end}} {{end}} With this code I am getting an error: Error while parsing unary expression: Expecting <expression> instead of &quot;CodeExit&quot; in: <operator> <expression>
It turns out that, at some point after adapting the sample app, we had removed some of the code that supported server-side rendering. I've been putting that back in and I'm now starting to see server-side rendering happening. My solution therefore was to follow the instructions for creating a JSS app for an older version of Sitecore, and compare the sample app code that generates to our own. In case that page vanishes the steps it lists are: Identify the correct JSS version for your Sitecore XP version (I used version 12 for Sitecore 9.2) Install the JSS CLI using npm i @sitecore-jss/sitecore-jss-cli@<version> (I already had this) Create the sample app with jss create my-jss-app react --branch release/12.0.0 Change to the directory cd my-jss-app Run jss start
How is Integrated mode configured for a Sitecore JSS React app? We have a Sitecore JSS app that has been working for some time in both Disconnected and Connected mode, locally in Docker and hosted on Azure App Services. It runs in the CM environment, and on a Node instance that connects to the layout service on CD. The app is written in TypeScript and compiled to ES5. We are using the following versions: Sitecore 9.2 JSS 12 Node 14.18.1 We now have a need to get it running in Integrated mode instead of Connected mode, ie to enable server-side rendering. There is documentation on Server-side rendering and integrated mode. The renderView function and WebPack library target is, and always has been, in place. The documentation says Experience Editor always uses Integrated mode. Our app is editable in Experience Editor, and using View Source I can see the HTML for components that is missing when I view the app outside of Experience Editor, therefore it is doing server-side rendering in that environment. The documentation refers to renderings being of a new type, React JavaScript Rendering, but that doesn't exist in the JSS 12 package. JavaScript Rendering does, so I think it's a typo or a pre-release name that changed. Our renderings are all based on JSON Rendering, so I've created a new rendering based on that and pointing to our site header component. I've added it to the presentation details for a page, with the same data source as the version that works client-side. However, the new rendering cannot find the JavaScript component. These are the settings for the new rendering: The result is the following error displayed on the page: Error Rendering Sitecore.JavaScriptServices.ViewEngine.Presentation.JavaScriptRenderer: The module &quot;C:\inetpub\wwwroot\dist\jss-app-name\server.bundle.js&quot; has no export named &quot;Header&quot; Error: The module &quot;C:\inetpub\wwwroot\dist\jss-app-name\server.bundle.js&quot; has no export named &quot;Header&quot; at C:\Windows\TEMP\4d5muhtz.2mg:116:21 at IncomingMessage. (C:\Windows\TEMP\4d5muhtz.2mg:137:41) at IncomingMessage.emit (events.js:400:28) at endReadableNT (internal/streams/readable.js:1334:12) at processTicksAndRejections (internal/process/task_queues.js:82:21) at Sitecore.JavaScriptServices.ViewEngine.NodeServices.HostingModels.Http.HttpNodeInstance.InvokeExport[T](NodeInvocationInfo invocationInfo) at Sitecore.JavaScriptServices.ViewEngine.NodeServices.HostingModels.OutOfProcessNodeInstance.InvokeExport[T](String moduleName, String exportNameOrNull, Object[] args) at Sitecore.JavaScriptServices.ViewEngine.NodeServices.DefaultNodeServices.InvokeExportWithPossibleRetry[T](String moduleName, String exportedFunctionName, Object[] args, Boolean allowRetry) at Sitecore.JavaScriptServices.ViewEngine.NodeServices.DefaultNodeServices.InvokeExport[T](String moduleName, String exportedFunctionName, Object[] args) at Sitecore.JavaScriptServices.ViewEngine.Node.NodeRenderEngine.Invoke[T](String moduleName, String functionName, Object[] functionArgs) at Sitecore.JavaScriptServices.ViewEngine.Presentation.JssRenderer.PerformRender(TextWriter writer, IRenderEngine renderEngine, String moduleName, String functionName, Object[] functionArgs) at Sitecore.JavaScriptServices.ViewEngine.Presentation.JssRenderer.Render(TextWriter writer) at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args) It is finding the JS file, because I get a different error if the path is wrong. I've tried specifying every JS file in the application in case the component is in a different file, but I always get the same message. The component is exported in the original TypeScript using export default Header; Ultimately we want to get this working on the separate Node environment via the node-headless-ssr-proxy which is already working for us in Connected mode, but at first I'd be happy to get it working in the CM or CD environment. Because it's working in Experience Editor I believe the prerequisites are in place and it's just a matter of configuration somewhere. Can anyone suggest how it needs to be configured?
Few ideas for troubleshooting. They are not really related to JSS, but still worth trying: Where are the servers located? When providing TTFB values are these from a region nearby? E.g. you are measuring from UK client to UK server? Or does it come to e.g. USA? We've been building multi-region delivery for global clients to save time on latency. Is it really JSS issue? I had a few issues in the past when the issue was related to xDB tracking slowing all responses. Maybe try disabling XP mode and testing the same page in XM mode just to remove any xDB pipelines and processing. It's not always possible within the solution, but still worth trying. Try investigating JSS response. We had a few components that looked very simple like banners with an Author field. Though when serializing it was loading a huge amount of dependencies through list and link fields. So simple banner that required only Author name was loading whole information about Author, all fields related to Author and then recursively it went down a few levels more. It was bloating JSS response to some crazy MBs for super simple components. We ended up with creating some custom field resolvers for such scenarios. Subsequent requests in your example take much less time than new session. Can it be related to the cold start of the application? It might be worth having some warm-up script to have these cached. Final idea - profiling ;) The performance issues are always a pain.
Layout Service performance optimisation I'm using the JSS Headless Proxy which calls down to the Layout Service for SSR. I'm seeing high TTFB to the Layout Service direct: New session: ~400ms to ~500ms Subsequent requests: ~200ms to ~300ms And therefore high TTFB to the rendered page (includes a 100ms graphQL request): New session: ~600ms to ~700ms Subsequent requests: ~400ms to ~500ms So layout service is taking a large portion of the time, and then converting the json layout to HTML on the proxy side is also pretty signficant. There is a decent amount of personalisation in use on various components and tracking is very important, so the caching options described in the documentation here are not able to be used. Is there any guidance / places to start digging on how to optimise this site?
When you retrieve a contact from xConnect, you should specify which facets should be returned with this contact by passing an array of facet keys into the ContactExpandOptions. The only facets that are always returned if they exist are ConsentInfo and MergeInfo as per Sitecore documentation. So, in your example, the call to client.Get<Contact> should look like: Sitecore.XConnect.Contact existingContact = client.Get<Contact>(new IdentifiedContactReference(&quot;ListManager&quot;, email), new ContactExpandOptions(PersonalInformation.DefaultFacetKey, &quot;CustomExmFacet&quot;)); If the requested facets exist, they will be added to the contact's Facets dictionary and can be retrieved using GetFacet<T>() method: var facet = existingContact.GetFacet<CustomExmFacets>(&quot;CustomExmFacet&quot;); If you still get null facet after adding &quot;CustomExmFacet&quot; to the ContactExpandOptions, please also check other potential reasons for this: the facet is not set for this contact (this can be checked in the table Contacts of xDB Shard databases) the combination of facet type and key is incorrect (this can be checked in the class where you defined the custom facet, see more details here)
Custom facet from a contact is coming null but when creating a new one Sitecore is complaining that the facet already exists I'm trying to write a .aspx script to update an existing contact in the experience profile, the basic logic is: get the contact by e-mail get a custom facet from the contact if the facet is null create a new one and fill some properties with random values else update the properties with some value The weird thing is the facet is coming null, so I'm creating a new one, but when I call the submit I'm getting the following error: Exception: Sitecore.XConnect.Operations.FacetOperationException Message: Operation #0, AlreadyExists, Contact {75e750cb-dc05-0000-0000-065e2a461d1a}, CustomExmFacets Source: Sitecore.Xdb.Common.Web Has someone faced this before? Here is the whole script <%@ Page Language=&quot;C#&quot; Debug=&quot;true&quot;%> <%@ Import Namespace=&quot;Microsoft.Extensions.DependencyInjection&quot; %> <%@ Import Namespace=&quot;Sitecore.XConnect.Collection.Model&quot; %> <%@ Import Namespace=&quot;System.IO&quot; %> <%@ Import Namespace=&quot;Sitecore.XConnect&quot; %> <%@ Import Namespace=&quot;Sitecore.XConnect.Client&quot; %> <%@ Import Namespace=&quot;Sitecore.XConnect.Collection.Model&quot; %> <%@ Import Namespace=&quot;Sitecore.XConnect.Client.Configuration&quot; %> <% var contactListId = new System.Guid(&quot;{70D937C2-D809-4CCE-B5B2-07C68DCAD230}&quot;); int batchSize = 200; // Size of the batch string[] facets = { CollectionModel.FacetKeys.PersonalInformation, CollectionModel.FacetKeys.ListSubscriptions, &quot;CustomExmFacet&quot; }; List<string> updatedContacts = new List<string>(); using (XConnectClient client = SitecoreXConnectClientConfiguration.GetClient()) { string email = &quot;[email protected]&quot;; Sitecore.XConnect.Contact existingContact = client.Get<Contact>(new IdentifiedContactReference(&quot;ListManager&quot;, email) , new ContactExpandOptions(PersonalInformation.DefaultFacetKey)); if (existingContact == null) { //Update CustomExmFacets type for some existing custom facet in your instance or use a Sitecore default one var facet = existingContact.GetFacet<CustomExmFacets>(&quot;CustomExmFacet&quot;); if (facet == null) { // Facet is new var newFacet = new CustomExmFacets { VideoUrl = videoUrl.Trim(), ThumbnailUrl = thumbnailUrl.Trim() }; client.SetFacet<CustomExmFacets>(existingContact, &quot;CustomExmFacet&quot;, newFacet); } else { facet.ThumbnailUrl = &quot;https://random.thumbnail.url.com&quot;; facet.VideoUrl = &quot;https://random.video.url.com&quot;; client.SetFacet<CustomExmFacets>(existingContact, &quot;CustomExmFacet&quot;, facet); updatedContacts.Add(email); } client.Submit(); } } %> <html> <head> <title>Updated Contact</title> </head> <body> <h1>Updated Contact</h1> <% foreach (string email in updatedContacts) { if (!string.IsNullOrEmpty(email)) { %> <p><% Response.Write(email); %></p> <% } }%> </body> </html>
Based on the link you have, I think you already have tried Prefetch config, but just in case, I will include it. Prefetch cache is the amount of data that Sitecore will load before anybody makes any data requests. The more you prefetch, the slower your startup will be but the less likely that a page request will need to load data. Also, the more you prefetch, the more system memory you use and the more data requests ping the data layer at startup. In general, you need to tweak this to a level that gives you an acceptable start up time, and doesn't consume all your system memory or pin your database. Or you may need to add more memory if you need more cache for some reason. Other items are loaded into cache after startup as needed. You alter the amount of prefetch by using a config patch to change the value of the prefetch cache size. Here is a version of the example from the docs: <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot; xmlns:set=&quot;http://www.sitecore.net/xmlconfig/set/&quot; xmlns:role=&quot;http://www.sitecore.net/xmlconfig/role/&quot;> <sitecore> <databases> <database id=&quot;web&quot; role:require=&quot;ContentDelivery or Standalone&quot;> <dataProviders> <dataProvider> <param desc=&quot;headProvider&quot;> <dataProvider> <prefetch> <cacheSize>1000MB</cacheSize> </prefetch> </dataProvider> </param> </dataProvider> </dataProviders> </database> </databases> </sitecore> </configuration> Reference the prefetch configuration docs here: https://doc.sitecore.com/xp/en/developers/102/platform-administration-and-architecture/configure-prefetch-cache-values.html You can also look to optimize what gets prefetched by configuring specific templates and item paths to load. This way you can prefetch only the pages you know are visited most often. You can see docs about this here: https://doc.sitecore.com/xp/en/developers/102/platform-administration-and-architecture/optimize-or-disable-the-prefetch-caches.html
When does prefetch cache filled up completely I was trying to see how much prefetch cache is being utilized on my CD server. I accessed cache status pages and found out that they are not getting filled after restarting the app (I made config changes to restart the app). I can say this because when app was restarted, prefetch cache value was 97.3MB, after 2 hours it became 393.3MB. What I understood from Sitecore documentations is, it get populated on app start. Is there something wrong with my understanding? What should I do to get an idea about cache usage? One more question, my server memory is varying between 68% to 72%, will increase in Cache max value make it worse? What is the general rule of caching with respect to memory usage?
Glass.Mapper.Sc requires a set of configuration files to be deployed to Sitecore: https://github.com/mikeedwards83/Glass.Mapper/tree/master/Source/Glass.Mapper.Sc/App_Config/Include/Glass Before the move the packageReferences, these config files would automatically be added and deployed to your Sitecore solution. Now you will need to manually add them to your Visual Studio solution to ensure they are correctly deployed.
Context is null in GlassMapperConfigurator I'm trying to access Sitecore 10.2 model fields using Glass.Mapper.Sc.92 version 5.8, and registered all Glass.Mapper services in GlassMapperConfigurator class. However facing the &quot;Context is null&quot; issue. Created another class to register the controller public class GlassCustomConfigurator: IServicesConfigurator { public void Configure(IServiceCollection serviceCollection) { serviceCollection.AddTransient<FooterController>(); } } Controller code: public class FooterController : Controller { private readonly IMvcContext _mvcContext; public FooterController(IMvcContext mvcContext) { _mvcContext = mvcContext; } public ActionResult Footer() { var model = _mvcContext.GetContextItem<FooterModel>(); return View(model); } } GlassCustom.config to register the services <configuration xmlns:patch=&quot;http://www.sitecore.net/xmlconfig/&quot;> <sitecore> <services> <configurator type=&quot;Test.GlassCustomConfigurator, Test&quot; /> <configurator type=&quot;Test.GlassMapperConfigurator, Test&quot; /> </services> </sitecore> </configuration> Any idea how can I fix this issue?
The user which doesn't see default sections must check Standard fields in VIEW ribbon in Content Editor:
Content Manager not seeing default sections on items I have two users with the same roles and the difference between them is that one can not see the default sections on all the items (Advanced, Appeareance, Help,...). Where do I set the permissions so the other content manager can also see these sections? He espacially needs it for the &quot;never publish&quot; checkbox.
Assuming that there is new version created when items are being edited, you can take the latest version and previous version and compare each field. Item originalItem = newItem.Database.GetItem(newItem.ID, newItem.Language, newItem.Version - 1); newItem.Fields.ReadAll(); IEnumerable<string> fieldNames = newItem.Fields.Select(f => f.Name); IEnumerable<string> differences = fieldNames.Where(fieldName => newItem[fieldName] != originalItem[fieldName]).ToList(); Of course, you should check if there is even older version of that item.
How to get Sitecore Updated Field only? I want to send only updated fields for Translation. How can I know which fields have been updated on an item?
OOTB it is not possible adding dynamic placeholder via Content editor. We can add dynamic placeholder only by experience editor.
Using Sitecore 10 Dynamic Placeholder via Content Editor Before Sitecore had a native Dynamic Placeholder implementation, some of the implementations floating around would allow you to use a Dynamic Placeholder as a regular one. Specifically, you could still attach renderings to the Dynamic Placeholder via Content Editor by specifying just the placeholder key, without the Rendering's UniqueId or placeholder counter. I have a use case where content authors prefer to add renderings via the Content Editor in certain situation and the rendering with the Dynamic Placeholder that they are using isn't necessarily going to be repeated on this page type. The desired result is that @Html.Sitecore().DynamicPlaceholder(&quot;content&quot;) would be able to recognize both &quot;content-{XXXGUIDXXX}-0&quot; *and* just &quot;content&quot;. Is there a good solution for this in SC10?