output
stringlengths 34
25.7k
| instruction
stringlengths 81
31k
| input
stringclasses 1
value |
---|---|---|
The problem is with your GetSearchPredicate method.
First you create orPredicate which is always false
var orPredicate = PredicateBuilder.False<ProductSearchResultItem>();
Then you use never add any Or conditions to it and instead you use it in finalPredicate:
var finalPredicate = andPredicate.And(orPredicate);
Remove that orPredicate or use it like:
var colorExpression = PredicateBuilder.False<ProductSearchResultItem>();
colorExpression = colorExpression.Or(o => o.Color == "black");
colorExpression = colorExpression.Or(o => o.Color == "white");
andExpression = andExpression.And(colorExpression);
| Solr query not returning search results
I can see all the records in the Solr portal when I run the query. Here is the data of one product.
https://localhost:8983/solr/stratum_products_master_index/select?q=_templatename%3A%22product%20details%20page%22
{
"category_t_en":"Lipstick",
"_indexname":"stratum_products_master_index",
"is_active_b":true,
"category_t":"Lipstick",
"title_t_en":"Claire",
"producttags_sm":["Cosmetics"],
"price_t_en":"15",
"productimageurl_s":"/-/media/Stratum/Project/Demo/assets/img/products/product-3.jpg",
"_templatename":"Product Details Page",
"tags_sm":["8f44b11cd2fd4d10b43ed16b847b4f9b"],
"price_t":"15",
"title_t":"Claire",
"_name":"claire",
"_database":"master",
},
But the code doesn't return any results. I doubt if the reason is the predicate, but I'm unable to figure out what.
ProductsController.cs
BaseSearchResult<ProductSearchResultItem> result = productSearcher.GetSearchResult("stratum_products_master_index", "", "", 1, 5);
ProductSearchResultItem.cs
public class ProductSearchResultItem : SearchResultItem
{
[IndexField("is_active")]
public bool IsActive { get; set; }
[IndexField("title")]
public string Title { get; set; }
[IndexField("category")]
public string Category { get; set; }
[IndexField("tags")]
public IEnumerable<Guid> Tags { get; set; }
[IndexField("productimageurl")]
public string ProductImageUrl { get; set; }
[IndexField("producttags")]
public List<string> ProductTags { get; set; }
[IndexField("productpricedisplay")]
public string ProductPriceDisplay { get; set; }
}
patch.config
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
<sitecore role:require="Standalone or ContentDelivery or ContentManagement" search:require="solr">
<contentSearch>
<indexConfigurations>
<defaultSolrIndexConfiguration>
<documentOptions>
<fields hint="raw:AddComputedIndexField">
<field fieldName="ProductImageUrl" returnType="string">Stratum.Feature.PageContent.ComputedIndexFields.ProductImageUrl, Stratum.Feature.PageContent</field>
<field fieldName="ProductTags" returnType="stringCollection">Stratum.Feature.PageContent.ComputedIndexFields.ProductTags, Stratum.Feature.PageContent</field>
<field fieldName="ProductPriceDisplay" returnType="string">Stratum.Feature.PageContent.ComputedIndexFields.ProductPriceDisplay, Stratum.Feature.PageContent</field>
</fields>
</documentOptions>
</defaultSolrIndexConfiguration>
</indexConfigurations>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="stratum_products_master_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<param desc="name">$(id)</param>
<param desc="core">stratum_products_master_index</param>
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" role:require="(ContentManagement and !Indexing) or (ContentDelivery and !Indexing)" />
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsyncSingleInstance" role:require="Standalone or (ContentManagement and Indexing) or (ContentDelivery and Indexing)" />
</strategies>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>master</Database>
<Root>/sitecore/content/Tenant/Stratum/Home/products</Root>
</crawler>
</locations>
<enableItemLanguageFallback>false</enableItemLanguageFallback>
<enableFieldLanguageFallback>false</enableFieldLanguageFallback>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
ProductSearcher.cs
public class ProductSearcher
{
private SearchService searchService = new SearchService();
public BaseSearchResult<ProductSearchResultItem> GetSearchResult(string searchIndexName, string searchTerm, string tagId, int pageNumber, int pageSize)
{
var query = GetSearchQuery(searchTerm, tagId, pageNumber, pageSize);
BaseSearchResult<ProductSearchResultItem> result = searchService.GetSearchResults<ProductSearchResultItem>(searchIndexName, query);
return result;
}
private IQueryable<ProductSearchResultItem> GetSearchQuery(string searchTerm, string tagId, int pageNumber, int pageSize)
{
var predicate = GetSearchPredicate(searchTerm, tagId);
IQueryable<ProductSearchResultItem> query = searchService.GetSearchQuery<ProductSearchResultItem>(Constants.SearchIndexes.Products, predicate);
/// Apply pagination
query = query.Page(pageNumber, pageSize);
return query;
}
private Expression<Func<ProductSearchResultItem, bool>> GetSearchPredicate(string searchTerm, string tagId)
{
Item productDetailsTemplateItem = SitecoreUtility.GetItem(Templates.ProductDetailsPage.ID);
string productDetailsTemplateName = productDetailsTemplateItem != null ? productDetailsTemplateItem.Name : string.Empty;
/// Initialize queries with True for AND queries and False for OR queries
var andPredicate = PredicateBuilder.True<ProductSearchResultItem>();
var orPredicate = PredicateBuilder.False<ProductSearchResultItem>();
if (!string.IsNullOrWhiteSpace(productDetailsTemplateName))
{
/// get only product pages
andPredicate = andPredicate.And(x => x.TemplateName.Equals(productDetailsTemplateName, StringComparison.InvariantCultureIgnoreCase));
int test = 1;
/// get only active products
if (test == 1)
{
andPredicate = andPredicate.And(x => x.IsActive);
}
///filter by searchTerm
if (test == 1)
{
if (!string.IsNullOrWhiteSpace(searchTerm))
{
andPredicate = andPredicate.And(x => x.Title.Like(searchTerm, 0.75f));
}
}
///filter by tag
if (test == 1)
{
if (!string.IsNullOrWhiteSpace(tagId))
{
andPredicate = andPredicate.And(x => x.Tags.Contains(new Guid(tagId)));
}
}
}
/// append the naming predicate to the overall filter predicate
var finalPredicate = andPredicate.And(orPredicate);
return finalPredicate;
}
}
SearchService.cs
public class SearchService
{
public IQueryable<T> GetSearchQuery<T>(string searchIndexName, Expression<Func<T, bool>> predicate) where T : SearchResultItem
{
IQueryable<T> query;
using (var context = ContentSearchManager.GetIndex(searchIndexName).CreateSearchContext())
{
query = context.GetQueryable<T>().Filter(predicate);
}
return query;
}
public BaseSearchResult<T> GetSearchResults<T>(string searchIndexName, IQueryable<T> query) where T : SearchResultItem
{
int totalResults = 0;
List<T> resultsByFilters = null;
/// get the index
ISearchIndex searchIndex = ContentSearchManager.GetIndex(searchIndexName);
/// create a search context
using (IProviderSearchContext context = searchIndex.CreateSearchContext())
{
/// get results from this index based on query
SearchResults<T> searchResults = query.GetResults();
if (searchResults != null)
{
totalResults = searchResults.TotalSearchResults;
resultsByFilters = searchResults.Hits.Select(x => x.Document)?.ToList();
}
return new BaseSearchResult<T>
{
TotalResults = totalResults,
ResultsByFilters = resultsByFilters
};
}
}
}
Update
This is the query logged in Search.log
24840 18:11:08 INFO Solr Query - ?q=*:* AND _val_:__boost&start=3&rows=3&fl=*,score&fq=-*:*&fq=_indexname:(stratum_products_master_index)&wt=xml
| |
You should not use fq parameter in your queries - you should use q parameter instead.
What you send now to Solr is:
INFO Solr Query - ?q=: AND val:__boost&start=3&rows=3&fl=*,score&fq=((_templatename:("Product Details Page") AND _language:("en")) AND is_active_b:("True"))&fq=_indexname:(stratum_products_master_index)&wt=xml
q parameter says "anything in _boost order"
start from 3rd item
return 3 documents
and filter results with ((_templatename:("Product Details Page") AND _language:("en")) AND is_active_b:("True"))
The whole filter should be already in q query.
The only thing you have to change is how you pass your predicate to context.GetQueryable. You should not use
query = context.GetQueryable<T>().Filter(predicate);
and instead you should use
query = context.GetQueryable<T>().Where(predicate);
With that, your predicate will be used in query (q) parameter and sorting with pagination will be applied correctly.
Also when you use query.Page(pageNumber, pageSize); with 1 for pageNumber, you in fact request for second page of the search results. pageNumber is 0-based. If you want first page and you got 1 from the calling method, you need to use
query.Page(pageNumber - 1, pageSize);
| Solr - How to fetch data by page
There are no results when I apply pagination to the query. But when I comment that code, I get results.
Search log without pagination:
INFO Solr Query - ?q=: AND
val:__boost&start=0&rows=1000000&fl=*,score&fq=((_templatename:("Product Details Page") AND _language:("en")) AND
is_active_b:("True"))&fq=_indexname:(stratum_products_master_index)&wt=xml
Search log with pagination:
INFO Solr Query - ?q=: AND
val:__boost&start=3&rows=3&fl=*,score&fq=((_templatename:("Product Details Page") AND _language:("en")) AND
is_active_b:("True"))&fq=_indexname:(stratum_products_master_index)&wt=xml
I observe that for some reason it is start=3 even when I'm passing pageNumber=1 & pageSize=3.
When I comment this line, it works
query = query.Page(pageNumber, pageSize);
Where am I going wrong.
private IQueryable<ProductSearchResultItem> GetSearchQuery(string searchTerm, string tagId, int pageNumber, int pageSize)
{
var predicate = GetSearchPredicate(searchTerm, tagId);
IQueryable<ProductSearchResultItem> query = searchService.GetSearchQuery<ProductSearchResultItem>(Constants.SearchIndexes.Products, predicate);
/// Apply pagination
query = query.Page(pageNumber, pageSize);
return query;
}
private Expression<Func<ProductSearchResultItem, bool>> GetSearchPredicate(string searchTerm, string tagId, string languageRegionalIsoCode = "en")
{
Item productDetailsTemplateItem = SitecoreUtility.GetItem(Templates.ProductDetailsPage.ID);
string productDetailsTemplateName = productDetailsTemplateItem != null ? productDetailsTemplateItem.Name : string.Empty;
/// Initialize queries with True for AND queries and False for OR queries
var andPredicate = PredicateBuilder.True<ProductSearchResultItem>();
if (!string.IsNullOrWhiteSpace(productDetailsTemplateName))
{
/// get only product pages of the specified language
andPredicate = andPredicate.And(x => x.TemplateName.Equals(productDetailsTemplateName, StringComparison.InvariantCultureIgnoreCase));
///get items of specified language
andPredicate = andPredicate.And(x => x.Language.Equals(languageRegionalIsoCode, StringComparison.InvariantCultureIgnoreCase));
/// get only active items
andPredicate = andPredicate.And(x => x.IsActive);
///filter by searchTerm
if (!string.IsNullOrWhiteSpace(searchTerm))
{
andPredicate = andPredicate.And(x => x.Title.Like(searchTerm, 0.75f));
}
///filter by tag
if (!string.IsNullOrWhiteSpace(tagId))
{
andPredicate = andPredicate.And(x => x.Tags.Contains(new Guid(tagId)));
}
}
return andPredicate;
}
| |
You're moving in the right direction. You should keep in mind that you can call only mocked methods. The SetItemField method is configured to return field by name:
item.Fields[fieldName].Returns(field);
... while the GetRelatedContent method tries to retrieve the field via ID:
MultilistField selectedItems = new MultilistField(
documentItem.Fields[Templates.Document.Fields.RelatedDocuments]);
In order to get the field, the following code should be used:
var multilistField = new MultilistField(documentItem.Fields["RelatedDocument"]);
Assert.Equal(2, multilistField.Count); //pass
In order to get fields by name or id, the SetItemField method can be extended with (for instance) optional fieldId parameter:
private void SetItemField(Item item, string fieldName, string fieldValue, ID fieldId = null)
{
fieldId = fieldId ?? ID.NewID; // new line
item[fieldName].Returns(fieldValue);
item[fieldId].Returns(fieldValue); // new line
var field = Substitute.For<Field>(fieldId, item);
field.Database.Returns(item.Database);
field.Value = fieldValue;
item.Fields[fieldName].Returns(field);
item.Fields[fieldId].Returns(field); // new line
}
Now the field can be retrieved via ID as well:
var RelatedDocumentFieldId = ID.NewID;
SetItemField(documentItem, "RelatedDocument", $"{item1.ID}|{item2.ID}", RelatedDocumentFieldId);
var multilistField = new MultilistField(
documentItem.Fields[RelatedDocumentFieldId]);
Assert.Equal(2, multilistField.Count); // pass
| Sitecore Unit Testing Trouble w/ NSubstitute and Nunit
I am newer to Sitecore and extremely new to its unit testing. been following examples online that mimic exactly what I am trying to accomplish but I seem to be getting an object reference(you will see the error in the screenshots) not set to an instance for an item that I am passing through a function on the unit test and in the function. We had other contracted Sitecore developers on the project in the past write unit tests the same way I am here but their unit tests are passing while throwing that object reference error from their tests. I am working on a Sitecore 10.1 project solution, not that it matter in this situation i think. I am attaching screenshots for clarity on the errors and stack traces. Is this normal for how the unit tests are supposed to be working with Nsubstitute and Sitecore, maybe I am missing the point with how Sitecore works with Unit tests. Please let me know your thoughts :)
private Item CreateItem(Database database = null)
{
var db = database ?? Substitute.For<Database>();
var item = Substitute.For<Item>(ID.NewID, ItemData.Empty, db);
var fields = Substitute.For<FieldCollection>(item);
item.Fields.Returns(fields);
db.GetItem(item.ID).Returns(item);
db.GetItem(item.ID.ToString()).Returns(item);
return item;
}
private void SetItemField(Item item, string fieldName, string fieldValue)
{
item[fieldName].Returns(fieldValue);
var field = Substitute.For<Field>(ID.NewID, item);
field.Database.Returns(item.Database);
field.Value = fieldValue;
item.Fields[fieldName].Returns(field);
}
It seems to be something wrong with how I am setting up the unit tests itself but I have included the whole run through for clarity. If you have any other suggestions for unit testing with Sitecore, I am very open to learning new things with Sitecore :)
| |
Just add the following processor to forms.renderField pipeline:
public class RenderFieldSpecificJavascript : MvcPipelineProcessor<RenderFieldEventArgs>
{
public override void Process(RenderFieldEventArgs args)
{
if (args.RenderingSettings.FieldTypeId == "{4EE89EA7-CEFE-4C8E-8532-467EF64591FC}" // your custom field ID
&& HttpContext.Current.Items.Contains("ExperienceFormsScriptsKey"))
{
var dict = (Dictionary<string, IHtmlString>) HttpContext.Current.Items["ExperienceFormsScriptsKey"];
dict["MyCustomField"] = new HtmlString("<script src=\"/my-custom-script.js\"></script>");
}
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<forms.renderField>
<processor
type="My.Assembly.Namespace.RenderFieldSpecificJavascript, My.Assembly"
patch:before="processor[@type='Sitecore.ExperienceForms.Mvc.Pipelines.RenderField.IncludeConditions, Sitecore.ExperienceForms.Mvc']"/>
</forms.renderField>
</pipelines>
</sitecore>
</configuration>
It will render your script at the end of the <body>:
| Automatically add a javascript when a certain form field is added
I understand that in order to add a script in Sitecore Forms, I must add it in the script field of the form. However, this could be cumbersome for the content editors since they would have to add the script every time they make a form. Plus, this new custom javascript does not need to be in all forms but only in select forms where a particular field is added.
Is there a way to automatically add that custom script only when a particular field is added?
| |
Check your @sitecore-jss/sitecore-jss-nextjs version, if it is 20.1.0 or later then use NextImage component
It shows how to display a responsive, optimized, editable image:-
<NextImage field={props.fields.image} height="51" width="204" />
below example shows how to display a non-editable image where you control the resizing and editing:
<NextImage
field={props.fields.image}
editable={false}
unoptimized={true}
imageParams={{ mw: 100, mh: 50 }}
height="50"
width="94"/>
Here's a Link https://doc.sitecore.com/xp/en/developers/hd/201/sitecore-headless-development/configuring-the-jss-nextimage-component.html
| The expected type comes from property 'field' which is declared here on type 'IntrinsicAttributes & TextProps'
In terms of Sitecore NextJS, I'm a complete beginner. This problem is beyond my knowledge. Please assist me in resolving the following issues.
Complete Code:
import {
Text,
Field,
withDatasourceCheck,
Item,
Image as JssImage,
ImageField,
} from '@sitecore-jss/sitecore-jss-nextjs';
import { ComponentProps } from 'lib/component-props';
type IconTitleDescriptionListProps = ComponentProps & {
fields: {
title: Field<string>;
description: Field<string>;
IconTitleDescriptionList: Item[];
image: ImageField;
};
};
const IconTitleDescriptionList = (props: IconTitleDescriptionListProps): JSX.Element => (
<section className="py-5" id="features">
<div className="container px-5 my-5">
<div className="row gx-5">
<div className="col-lg-4 mb-5 mb-lg-0">
<h2 className="fw-bolder mb-0">
<Text field={props?.fields?.title} />
</h2>
<p className="mb-0">{props?.fields?.description?.value}</p>
</div>
<div className="col-lg-8">
<div className="row gx-5 row-cols-1 row-cols-md-2">
{props?.fields?.IconTitleDescriptionList?.map((element, index) => {
return (
<div key={index} className="col mb-5 h-100">
<div className="feature bg-primary bg-gradient text-white rounded-3 mb-3">
<i className="bi bi-collection"></i>
</div>
<JssImage classsName="img-fluid rounded-3 my-5" field={element?.fields?.image} />
<h1 className="h1">
<Text field={element?.fields?.title} />
</h1>
<p className="h3">
<Text field={element?.fields?.SubTitle} />
</p>
<p className="mb-0">
<Text field={element?.fields?.description} />
</p>
</div>
);
})}
</div>
</div>
</div>
</div>
</section>
);
export default withDatasourceCheck()<IconTitleDescriptionListProps>(IconTitleDescriptionList);
Errors:
#Error 1:
(property) ImageProps.field?: ImageField | ImageFieldValue | undefined
Image field data (consistent with other field types)
Type 'Item | Item[] | Field<GenericFieldValue> | undefined' is not assignable to type 'ImageField | ImageFieldValue | undefined'.
Type 'Item' is not assignable to type 'ImageField | ImageFieldValue | undefined'.
Type 'Item' is not assignable to type 'ImageFieldValue'.
Index signature for type 'string' is missing in type 'Item'.ts(2322)
Image.d.ts(35, 5): The expected type comes from property 'field' which is declared here on type 'IntrinsicAttributes & ImageProps'
# Error 2:
(property) TextProps.field?: TextField | undefined
The text field data.
Type 'Item | Item[] | Field<GenericFieldValue> | undefined' is not assignable to type 'TextField | undefined'.ts(2322)
Text.d.ts(9, 5): The expected type comes from property 'field' which is declared here on type 'IntrinsicAttributes & TextProps'
Reference screens :
| |
I found the solution to this by updating two values in the following file in the identity server.
wwwroot\<your-identity-server>\sitecore\Sitecore.Plugin.IdentityServer\Config\identityServer.xml
So you need to update the Identity Token to update the logout time. Here are steps.
You need to udpate the IdentityTokenLifetimeInSeconds, so in my case I updated it to 60 seconds like below.
<IdentityTokenLifetimeInSeconds>60</IdentityTokenLifetimeInSeconds>
I also find out one more property by the help of comments given in this config i.e. CookieLifetime. So I updated it like below.
<!-- Sets the identity server cookie lifetime -->
<CookieLifetime>0.00:01:00</CookieLifetime>
Finally you need to restart the Sitecore Identity Server so that the updated configuration is consumed on startup.
And it worked. User was able to logout after a minute.
I referred to this article to identify.
https://andrewsutherland.azurewebsites.net/2020/03/15/sitecore-identity-server-increasing-the-token-lifetime-for-local-development/
And then I wrote this article with all the details.
https://sbhatiablogs.wordpress.com/2023/02/23/how-to-change-sitecore-identity-server-logout-time/
Hope this helps.
| Modifying session timeout for content authors not working
We are working on Sitecore 10.2 Instance, where we want the Content Author to be logged out after 5 minutes of inactivity.
For that, we have made the changes in the below files, but it didn’t work:
Web.Config :
Sitecore.Owin.Authentication.config
I also followed the below thread but it didn't work for me on Sitecore 10.2.
How do I set session timeouts in Sitecore?
| |
If you see the document provided for the Sitecore Content hub, here are the steps to configure your publishing settings given in this reference document.
Configure the publishing settings
The final steps say about these options are given below.
Click Publish schema to publish changes to the schema.
Click Publish all to CaaS to publish all publishable entities
And for your error, if you see the conversation given in the below thread, you will get to know that API creation is a known issue. So if you are using 4.0 sandbox then upgrade it to 4.0.1 and its solved already there.
While access preview API for Sitecore Content Hub, getting "HTTP ERROR 401" This page isn’t working error
| Unable to create API Key
I have superuser access and created a CMP Content Collection. Added an existing item of Type - Advertisement.
When I try to create an API key, it does nothing.
In the console I see this error -
500 "An internal server error occurred"
.
In the `PublishingSettings", both "Publishing enabled" & "Auto publishing enabled" are checked.
I have clicked on both "Publish schema" & "Publish to Caas".
Please let me know what do these two CTAs ("Publish schema" & "Publish to Caas") do and when to use which. Is there an order of publish among these two.
If we have to do a parallel comparison with Sitecore CMS, is "Publish to Caas" like "Publish to web". If yes, then what is Publishing Schema.
How to fix the API Key creation error.
When I load the content collection page, there is an error. Would this be related?
We have only one environment for Content Hub and its content is being used in live sites. So, this may not be a Sandbox.
| |
In the content Hub follow below -
On the menu bar, click Manage Icon.
On the Manage page, click Pages.
Reorder pages as per your requirement by drag and drop using icon
Then refresh the page you will notice the changes.
| Reorder the top menu items
I want to reorder the top menu items. Is it possible?
Thank you!
| |
As you mentioned that the issue is showing for some specific items, so the issue is looking like any JS is conflicting with the JS of the experience editor. You can do the following.
Check the page by removing all the components and see if it is created by any specific component?
If you find any jquery code, try to use jQuery in your code in the NoConflict mode as jQuery uses the $ sign but Sitecore also, which could cause conflicts.
Use this thread for more details as it looks like a conflict issue to me.
https://stackoverflow.com/questions/16198315/sitecore-page-editor-javascript-error
| Experience editor - not able to edit renderings or make changes to page layouts
We are using Sitecore 9.3 and facing issues with the experience editor only for some specific page items. We are unable to make any edits to the renderings in the Experience editor (Basically the editor tools are not showing up). Placeholder settings are configured correctly and working for other pages. When inspecting the browser we could see the below console errors. We are facing this issue only for experience editor.
Uncaught TypeError: Sitecore.PageModes.ChromeManager.hoverFrame() is undefined
Note: we are using Vue.js for our front end.
| |
SXA generates the robots.txt file by running the processor Sitecore.XA.Foundation.SiteMetadata.Pipelines.HttpRequestBegin.RobotsHandler in the <httpRequestBegin> pipeline.
If the requested URL ends with /robots.txt and the context website is an SXA site, this processor will try to generate the robots file content for all SXA sites that match the current domain and absolute path. It will run a special pipeline <getRobotsContent> for each site. This pipeline includes 3 processors:
<getRobotsContent>
<processor type="Sitecore.XA.Foundation.SiteMetadata.Pipelines.GetRobotsContent.GetContentFromSettings, Sitecore.XA.Foundation.SiteMetadata" resolve="true" />
<processor type="Sitecore.XA.Foundation.SiteMetadata.Pipelines.GetRobotsContent.GetDefaultRobotsContent, Sitecore.XA.Foundation.SiteMetadata" resolve="true" />
<processor type="Sitecore.XA.Foundation.SiteMetadata.Pipelines.GetRobotsContent.AppendSitemapUrl, Sitecore.XA.Foundation.SiteMetadata" resolve="true" />
</getRobotsContent>
GetContentFromSettings retrieves content from the field Robots content of Site Settings
If there is no content in this field, GetDefaultRobotsContent will try to read a physical robots.txt file. If the file does not exist or it is empty, the following content will be added by default:
"User-agent: *\nDisallow: " + args.Site.VirtualFolder
Then AppendSitemapUrl processor will add a line with sitemap URL for the site
As a final step, RobotsHandler will take generated content for all sites, reorder lines and remove redundant line breaks.
Now, to answer your questions:
Yes, this is correct. Sitecore will either read content from the CMS field or the robots.txt file.
I think it makes sense to disallow robot indexing by default, otherwise it would be easy to let bots crawl pages or files that should not be indexed and cause a lot of problems with unwanted URLs appearing in search results.
This must be happening because of the way how "matching sites" are detected based on their hostnames, ports and virtual folders. It looks like for your request https://mysite.local/robots.txt it finds only two matching sites.
Here is the method that is responsible for this:
protected virtual IList<SiteContext> GetMatchingSites(HttpRequestArgs args)
{
Uri uri = new Uri(HttpContext.Current.Request.Url, args.HttpContext.Request.RawUrl);
return (IList<SiteContext>) this.GetSiteContexts(uri.Host, uri.AbsolutePath, uri.Port).Where<SiteContext>((Func<SiteContext, bool>) (context => context != null)).Where<SiteContext>((Func<SiteContext, bool>) (context => context.IsSxaSite())).ToList<SiteContext>();
}
protected virtual IEnumerable<SiteContext> GetSiteContexts(string hostName, string fullPath, int portNumber)
{
fullPath = fullPath.ToLowerInvariant();
foreach (SiteInfo site in this.GetSites())
{
fullPath = site.VirtualFolder + fullPath;
if (site.Matches(hostName, fullPath, portNumber))
yield return new SiteContext(site);
}
}
Please double check your site configuration and compare their hostnames, ports and virtual folders, this can explain why some of the sites are excluded from the RobotsHandler processor.
| How is robots.txt content created
This is a multisite implementation with sites under one tenant. There is no robots.txt file in the root.
This is what I have tried:
I have cleared the content for Robots content field for all sites. On browsing the URL https://mysite.local/robots.txt, the content rendered is:
User-agent: *
Disallow: /
Disallow: /in/
Sitemap: https://mysite.local/sitemap.xml
Sitemap: https://mysite.local/in/sitemap.xml
Could not understand where the entry for Disallow: /in/ is coming from and why are there only 2 sitemap URLs when there are multiple sites.
Added robots.txt file in the root with just this Disallow: /includes/. On browsing the URL https://mysite.local/robots.txt, the content rendered is:
User-agent: *
Disallow: /includes/
Sitemap: https://mysite.local/sitemap.xml
Sitemap: https://mysite.dev.local/in/sitemap.xml
In each Site Settings' Robots content field, added the value Disallow: /assets-<sitecode>/.
e.g.: Disallow: /assets-shared/, Disallow: /assets-intl/, Disallow: /assets-sg/ etc.
On browsing the URL https://mysite.local/robots.txt, the content rendered is:
User-agent: *
Disallow: /assets-in/
Disallow: /assets-intl/
Sitemap: https://mysite.local/sitemap.xml
Sitemap: https://mysite.local/in/sitemap.xml
The issue is not with publishing items as all sites are configured to master.
I could not find the information I was looking for here. Please help me understand the following:
Sitecore will only read either from CMS field or the robots.txt file and not both. Is that correct?
If Robots content field is empty, Sitecore adds Disallow: / as default. But this prevents Google bots from indexing and crawling the website.
Sorry, no idea on SEO things, but disallowing shouldn't be the default. Is that correct?
Is there any config setting that can prevent this, I mean, Robots content is empty and Disalow: / shouldn't be added.
As mentioned above, Disallow: /in/ is being added and only two sitemap URLs added even when none of the CMS fields have those values. The system is reading CMS field only from the International & India Site Settings when there are other sites too.
So, what other places should I check to troubleshoot.
Using Sitecore 10.2
| |
You have an issue while adding search term predicate to your query.
You just have your main query and you add OR Title Like SearchTerm OR ... so it's enough that title contains search term and none of the other conditions is needed to evaluate to true:
if (!string.IsNullOrWhiteSpace(searchTerm))
{
andPredicate = andPredicate.And(x => x.Title.Like(searchTerm, 0.75f));
foreach (var t in searchTerm.Split(' '))
{
var tempTerm = t;
andPredicate = andPredicate.Or(p => p.Title.MatchWildcard(tempTerm + "*").Boost(5.5f));
andPredicate = andPredicate.Or(p => p.Title.MatchWildcard(tempTerm + "*"));
andPredicate = andPredicate.Or(p => p.Title.Equals(tempTerm));
}
}
Instead it should be:
if (!string.IsNullOrWhiteSpace(searchTerm))
{
var titlePredicate = PredicateBuilder.False<ProductSearchResultItem>();
titlePredicate = titlePredicate.Or(x => x.Title.Like(searchTerm, 0.75f));
foreach (var t in searchTerm.Split(' '))
{
var tempTerm = t;
titlePredicate = titlePredicate.Or(p => p.Title.MatchWildcard(tempTerm + "*").Boost(5.5f));
titlePredicate = titlePredicate.Or(p => p.Title.MatchWildcard(tempTerm + "*"));
titlePredicate = titlePredicate.Or(p => p.Title.Equals(tempTerm));
}
andPredicate = andPredicate.And(titlePredicate);
}
| Results not filtering by language
I have an item which has 2 language versions - English & Chinese.
This Search query is returning both versions when the expected is only English.
Not passing the languageCode so by default it is en.
Is it the logic on how I'm building the predicate.
public BaseSearchResult<ProductSearchResultItem> GetSearchResult(string searchIndexName, string searchTerm, string tagId, int pageNumber, int pageSize)
{
var query = GetSearchQuery(searchTerm, tagId, pageNumber, pageSize);
BaseSearchResult<ProductSearchResultItem> result = searchService.GetSearchResults<ProductSearchResultItem>(searchIndexName, query);
return result;
}
private IQueryable<ProductSearchResultItem> GetSearchQuery(string searchTerm, string tagId, int pageNumber, int pageSize)
{
var predicate = GetSearchPredicate(searchTerm, tagId);
IQueryable<ProductSearchResultItem> query = searchService.GetSearchQuery<ProductSearchResultItem>(Constants.SearchIndexes.Products, predicate);
/// Apply pagination
query = query.Page((pageNumber - 1), pageSize);
return query;
}
private Expression<Func<ProductSearchResultItem, bool>> GetSearchPredicate(string searchTerm, string tagId, string languageRegionalIsoCode = "en")
{
Item productDetailsTemplateItem = SitecoreUtility.GetItem(Templates.ProductDetailsPage.ID);
string productDetailsTemplateName = productDetailsTemplateItem != null ? productDetailsTemplateItem.Name : string.Empty;
/// Initialize queries with True for AND queries and False for OR queries
var andPredicate = PredicateBuilder.True<ProductSearchResultItem>();
if (!string.IsNullOrWhiteSpace(productDetailsTemplateName))
{
/// get only product pages of the specified language
andPredicate = andPredicate.And(x => x.TemplateName.Equals(productDetailsTemplateName, StringComparison.InvariantCultureIgnoreCase));
///get items of specified language
andPredicate = andPredicate.And(x => x.Language.Equals(languageRegionalIsoCode, StringComparison.InvariantCultureIgnoreCase));
/// get only active items
andPredicate = andPredicate.And(x => x.IsActive);
///filter by searchTerm
if (!string.IsNullOrWhiteSpace(searchTerm))
{
andPredicate = andPredicate.And(x => x.Title.Like(searchTerm, 0.75f));
foreach (var t in searchTerm.Split(' '))
{
var tempTerm = t;
andPredicate = andPredicate.Or(p => p.Title.MatchWildcard(tempTerm + "*").Boost(5.5f));
andPredicate = andPredicate.Or(p => p.Title.MatchWildcard(tempTerm + "*"));
andPredicate = andPredicate.Or(p => p.Title.Equals(tempTerm));
}
}
///filter by tag
if (!string.IsNullOrWhiteSpace(tagId))
{
Guid tagGuid = new Guid(tagId);
andPredicate = andPredicate.And(x => x.Tags.Contains(tagGuid));
}
}
return andPredicate;
}
This is the query in Search.log
INFO Solr Query - ?q=(((((_templatename:("Product Details Page") AND
_language:("en")) AND is_active_b:("True")) AND title_t:(claire~0.75)) OR (title_t:(claire*))^5.5 OR title_t:(claire*) OR title_t:("claire"))
AND tags_sm:("8f44b11cd2fd4d10b43ed16b847b4f9b")) AND
val:__boost&start=0&rows=3&fl=*,score&fq=_indexname:(stratum_products_master_index)&wt=xml
claire is the "Title" of the item.
| |
Currently the MVP Directory is using Gravatar to display the photos of the MVPs.
To upload your photo please register an account with Gravatar and associate a photo with your email address.
If your photo already appears, but you want to change it then it means you should already have a Gravatar account. In this case, please log in and change your photo there.
If you don't know what email address the MVP Directory is using or you need to change the email address, please contact the Sitecore MVP Team at [email protected]
| How can I update my photo on the Sitecore MVP Directory?
I am (used to be) a Sitecore MVP and I appear in the Sitecore MVP Directory.
How can I upload or change my photo?
| |
Your Question is "response.filter (_response.Filter) after setting value using " new DeflateStream" or "new GZipStream" still gives you Null?
please debug DeflateStream or GZipStrem for Errors.
Please check the link https://learn.microsoft.com/en-us/dotnet/api/system.web.httpresponse.filter?view=netframework-4.8
If My understanding of your question is not correct, please Elaborate on your question further.
Hope this helps.
| Getting null reference error in response.filter while implementing gzip in sitecore website
I am getting null value in response.filter.Below is my code. I am getting response but in response.filter value is null.I am implementing it sitecore website.
using System.Web.Mvc;
using System.IO.Compression;
public class Compress:ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{ var _encodingsAccepted = filterContext.HttpContext.Request.Headers["Accept-Encoding"];
if (string.IsNullOrEmpty(_encodingsAccepted)) return;
_encodingsAccepted = _encodingsAccepted.ToLowerInvariant();
var _response = filterContext.HttpContext.Response;
if (_encodingsAccepted.Contains("deflate"))
{
_response.AppendHeader("Content-encoding", "deflate");
_response.Filter = new DeflateStream(_response.Filter, CompressionMode.Compress);
}
else if (_encodingsAccepted.Contains("gzip"))
{
_response.AppendHeader("Content-encoding", "gzip");
_response.Filter = new GZipStream(_response.Filter, CompressionMode.Compress);
}
}
}
| |
I tried it on my system and added all the references given in your question and in the article that you are following. And it works for me without any errors.
Here is my class.
using System;
using System.Linq.Expressions;
using Sitecore.Framework.Rules;
using Sitecore.XConnect;
using Sitecore.XConnect.Segmentation.Predicates;
namespace WebApplication1
{
public class PreferredCinemaMatches : ICondition, IContactSearchQueryFactory
{
public Expression<Func<Contact, bool>> CreateContactSearchQuery(IContactSearchQueryContext context)
{
throw new NotImplementedException();
}
public bool Evaluate(IRuleExecutionContext context)
{
throw new NotImplementedException();
}
}
}
And here are the reference that I have for my project.
You can verify all the references for your solution. Maybe you are missing something.
Hope it helps.
| The type or namespace name 'ICondition'/'IContactSearchQueryFactory' could not be found, despite references to appropriate dlls
In this Sitecore article, there is a code sample implements ICondition and IContactSearchQueryFactory. We believe that this code will help us to add custom rules to the Sitecore List Manager. However, when we try to implement this class, we get the errors "The type or namespace name 'ICondition' could not be found." and "The type or namespace name 'IContactSearchQueryFactory' could not be found."
We have added references to the dlls Sitecore.XConnect.Segmentation.Predicates.dll and Sitecore.Framework.Rules.dll (per this documentation for 9.1 - we're on Sitecore 10.2) from our sitecore instance, and they're referenced via usings in the file where we're trying to implement the class, but the error persists.
I'm wondering if there is a possibility that those are in a different DLL, otherwise I'm stumped as to why they wouldn't be found. Our code is exactly the same as the example in that sitecore article (see below). How can we resolve those two interfaces?
using System;
using System.Linq.Expressions;
using Sitecore.Framework.Rules;
using Sitecore.XConnect;
using Sitecore.XConnect.Segmentation.Predicates;
using Sitecore.XConnect.Collection.Model;
using System.Linq;
namespace Documentation.Examples
{
public class PreferredCinemaMatches : ICondition, IContactSearchQueryFactory
{
//implementation
}
}
| |
There are 2 Questions here:
1 - "looking to add a component to already existing pages. Since there are 100s
of pages of this type"
Answer:
You are thinking in the correct direction. Add the rendering with data source in _Standard Values of Template.
Note: If the data source expected for all the pages is different for the component you are trying to add, the approach will be different.
2 - Would this approach work even if the presentation details are overridden
Answer:
Basically, all the Components you add to the "_Standard Values" of a given template will be Stacked (no override)
Example: If you have a "NewsArticle" Component with placeholder "main", on the Page. Now you add the "NewsArticle" Component with the placeholder "main" into "_Standard Value" on a given template, and it will be added to controls.
| How can I add a component to already existing pages?
I am working on Sitecore Version 9.0.1. I am looking to add a component to already existing pages. Since there are 100s of pages of this type, I was thinking to add component rendering to the standard values of the template. My question is, would this approach work even if the presentation details are overridden or would it require some custom script to achieve the result?
| |
Assuming you want to serve compressed html to your visitors, the most popular method is gzip. Gzip compression is one of the standards of compression for the web; the other being deflate.
For a traditional Sitecore Asp.NET site (which Sitecore is built upon), the method to enable gzip compression is done by modifying your web.config and including something like below.
<system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" staticCompressionDisableCpuUsage="95" staticCompressionEnableCpuUsage="60" dynamicCompressionDisableCpuUsage="95" dynamicCompressionEnableCpuUsage="50">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="image/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="image/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>
You may noticed that there are two types of compression: static and dynamic.
Static compression compresses static content such as js, css, and images. Compression happens once. Subsequent requests will serve the already compressed files.
Dynamic compression compresses for each request and the content is not cached to a file. This would be appropriate for Sitecore pages as content may be dynamic.
Note: Please consider the performance of the site before implementing "Dynamic Compression", it may lead to Performance degradation. Please visit the Analysis done in this Url https://www.webperformance.com/library/reports/iis7_compression/
| How to compress and encode Html in sitecore website?
What is the best way to compress the Sitecore website? Do Sitecore provide any pipeline?
| |
The news is correct on June 30, 2023 Microsoft will retire version 4 for Azure Cache for Redis instances.
Azure Redis cache is the default private session provider that Sitecore uses on Azure.
According to the Sitecore Knowledgebase in Sitecore XP Azure Redis is supported (without version number mentioned) and all Redis on-prem versions are expected to work correctly.
The system requirements for a Sitecore XC 10.3 hosting environment mention that Azure Redis version 4.0.14 or later is needed and supported.
So based on the above you should be safe to upgrade your Azure Redis instance.
You can upgrade your Redis using the Azure portal:
In the Azure portal, select the Azure Cache for Redis instance that
you want to upgrade from Redis 4 to Redis 6.
On the left side of the
screen, select Advanced settings. If your cache instance is eligible
to be upgraded, you should see the following blue banner. If you
want to proceed, select the text in the banner.
A dialog box displays a popup notifying you that upgrading is permanent and might cause a brief connection blip. Select Yes if you would like to upgrade your cache instance.
To upgrade to Redis 6 you can also follow this guide:
https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-how-to-upgrade
UPDATE:
Sitecore released a Knowledge Base article to cover this topic,
including a statement: "Microsoft has stated that version 6 is compatible with version 4, and no changes are required in client applications to ensure compatibility."
Sitecore also released a service update for Managed Cloud, which states that you can update the instances yourself or if you need any further assistance, please raise a new support ticket on Sitecore support portal.
| Can I upgrade Azure Redis version 4 to version 6?
I heard that Microsoft will retire Azure Redis version 4. My Sitecore instance is using this resource. Am I safe to upgrade to Azure Redis version 6?
| |
This happens because your code installs packages with the Merge-Merge option:
new global::Sitecore.Install.Utils.BehaviourOptions(
global::Sitecore.Install.Utils.InstallMode.Merge,
global::Sitecore.Install.Utils.MergeMode.Merge));
This option instructs Sitecore to replace only matching items and versions from the package, for example if there is version 4 in the package, it will overwrite fields in the version 4 of the target item.
If you want to keep the existing item version and add the packaged content as a new version, then you should use the Merge-Append option:
new global::Sitecore.Install.Utils.BehaviourOptions(
global::Sitecore.Install.Utils.InstallMode.Merge,
global::Sitecore.Install.Utils.MergeMode.Append));
In your example, it will keep the existing version 5 and create a version 6 with content from the package, so installed content will become the latest version.
| Sitecore Package creation Install Ver in code c#
I have written code that creates packages in Sitecore ver 8 and uploads and publishes in sitecore 9. The code is done in C# create package and installing package and publishing the package.
Creating a package code was done with the help of using this link
https://hishaamn.wordpress.com/2016/11/07/sitecore-create-package-programmatically/
installing a package was also done searching code in stack exchange. code below
global::Sitecore.Context.SetActiveSite("shell");
using (new SecurityDisabler())
{
using (new SyncOperationContext())
{
using (new EventDisabler())
{
var db = Factory.GetDatabase("master");
using (var dbSwitcher = new DatabaseSwitcher(db))
{
try
{
global::Sitecore.Install.Framework.IProcessingContext context = new global::Sitecore.Install.Framework.SimpleProcessingContext();
global::Sitecore.Install.Items.IItemInstallerEvents events =
new global::Sitecore.Install.Items.DefaultItemInstallerEvents(
new global::Sitecore.Install.Utils.BehaviourOptions(global::Sitecore.Install.Utils.InstallMode.Merge,
global::Sitecore.Install.Utils.MergeMode.Merge));
context.AddAspect(events);
global::Sitecore.Install.Files.IFileInstallerEvents events1 = new global::Sitecore.Install.Files.DefaultFileInstallerEvents(true);
context.AddAspect(events1);
var inst = new global::Sitecore.Install.Installer();
ConfigurationManager.AppSettings.Set("MYImportRunning", "true");
global::Sitecore.Diagnostics.Log.Info("MY Import: Install Package start", this);
inst.InstallPackage(global::Sitecore.MainUtil.MapPath(path), context);
global::Sitecore.Diagnostics.Log.Info("My Import: Install Package end", this);
ConfigurationManager.AppSettings.Set("My.Running", "false");
}
catch (Exception e)
{
global::Sitecore.Diagnostics.Error.LogError(e.Message + e.StackTrace);
}
}
}
}
}
private void PublishLocations()
{
var publishSetting = global::Sitecore.Configuration.Settings.GetSetting("My.ImportPublish");
bool publish;
bool.TryParse(publishSetting, out publish);
if (publish)
PublishingHelper.PublishItem("/sitecore/content/Home/Pages", PublishMode.Smart, true, true);
}
The problem I am facing is, In sitecore 8 for example, I have a page Apple, and that page has 4 versions(ver1, ver2, ver3, ver4). Version 4 being the latest version. When the package is created it gets the latest 4th version. In sitecore 9 the same page Apple has 5 versions. When the package is installed and published it only updates the fourth version being the latest version. The 5 version is not updated because the 5 version is not there in sitecore 8 package.
My question is, is there a way when the package is installed and published in sitecore 9, it updates the latest versions of the page in sitecore 9 or is there any other way of doing this.
| |
I'd say it's simply not possible to cancel and rollback a publish job due to the nature of how publishing works in Sitecore. There is no history of what content was previously in the web database as it is being overwritten by a publish operation, regardless if using the built-in publishing or Sitecore Publish Service (SPS).
Since Sitecore doesn't have the history, you're basically left with just two options: Restore a database backup or rely on database transactions. You've already ruled out the backup/restore option, so database transaction is the last one to give a thought.
SPS have some kind of transaction support, but doesn't seem to be very well tested. Since SPS performs publishing in large batches, I think the idea was to avoid leaving the database in a corrupt state if something went wrong. Having this enabled can cause major issues as transactions become way too large to be practically handled. IIRC, transactions was enabled by default in early versions of SPS but was then changed to be disabled by default.
Theoretically, I guess you could enable transactions in SPS and try to find a way to cause SPS to crash, so that the database would rollback your content, but I would certainly not recommend it. Your largest publish operations must fit in a db transaction or you won't be able to publish it at all. If you can make your publish operations fit into a transaction, your solution is probably not big enough for SPS to be a viable option in the first place.
One can of course increase the size limit of a transaction in SQL Server, but that also comes with larger/longer commit/rollback execution times causing tons of other issues, such as timeouts etc. I've experimented with it - it's simply not worth it.
| Cancel the ongoing publishing
Sitecore: Sitecore.NET 10.1.1 (rev. 005862)
Publishing service: 5.0.0
I am trying to find a way to cancel the ongoing publishing and revert the changes done by the current publishing.
I have the following understanding:
Reverting the changes from the web database can only be done manually. Backup before publishing is not a feasible option.
During publishing Sitecore does the following internally.
-Creates manifests of items to be published.
-Moves items from the Master DB to the selected publishing target databases.
-Triggers re-indexing (re-indexing of published items or the whole site depends upon the number of items published and the value in config) and clears the cache.
I did see the articles:
https://mikael.com/2019/07/learnings-from-a-year-of-implementing-sitecore-publishing-service/
Guys, is there a way to achieve this? Or can you guide me in which direction I should work?
| |
This is not possible just out-of-the-box. What is mostly done in cases like this is to create an extra index field (ComputedIndexField) that will contain sdate or edate (depending on the template). This way you can use that field in the facet.
| Single SXA facet pointing to two different fields from different template
I have two different page types in the Sitecore 10.2 SXA search scope. So template1 contains sdate field and template2 contains edate field for date. I need to point the facet to both the fields in order to implement date range and sort by.
I tried using this field by adding sdate,edate in facet but did not work.
Can anyone help here?
| |
I was able to fix the issue! The problem lies on the SameSite cookie property of ASP.NET_SessionId and __RequestVerificationToken. By default, it was set to Lax. So, I created a pipeline that would change these cookies’ SameSite property to None and that resolved the issue.
Be sure that your .NET Framework version is 4.7.2 and later.
Reference:
https://web.dev/samesite-cookies-explained/
| Is it possible to add a Sitecore Form in an iframe?
We want to reference a page from Sitecore with a Sitecore Forms form inside it to an external site. However, when I did so. I encountered xxx things:
The iframe threw an error regarding the X-Frame-Options
To fix this, I added the frame-ancestors 'self' https://external.site in the header
Once this was resolved, every time I blur from the field it shows an alert popup saying Your session has expired. Please refresh the page
When I tried submitting the form, the form failed to submit. Upon checking, I discovered that the form submit returned a Message: The required anti-forgery cookie "__RequestVerificationToken" is not present. message.
So the question is: is it really possible to reference a Sitecore Form in an iframe? If yes, which area of the environment should I look for in order to resolve the issues #2, #3 above?
| |
This issue may be coming because while you are doing indexing from the control panel, it is throwing some errors and because of the error it is not indexing all articles.
I would suggest you check the Crawling.log log files and check if there is any error related to indexing.
| Solr Indexing issue in Sitecore 10.2
I am using Sitecore 10.2 with SXA and I am using sitecore_sxa_web_index index. I have multiple articles which I am indexing. I am facing below issue:
Suppose I have 10 articles and when I manually do publish (republish) then in Solr it shows 10 articles.
When I do publish article as a Smart publish then it shows 3 article only.
When I rebuild indexes from control panel then it shows 3 articles only.
Below is my publishing strategy:
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
</strategies>
| |
There is no specific version compatibility between Redis and StackExchange.Redis library (see GitHub link). Azure Redis and StackExchange.Redis are compatible as long as they are using the same RESP (REdis Serialization Protocol) version.
Redis version 6 and above supports two protocols: the old protocol, RESP2, and a new one introduced with Redis 6, RESP3. In Redis 6 connections start in RESP2 mode, so clients implementing RESP2 do not need to be updated or changed (documentation link).
StackExchange.Redis library currently does not support RESP3, therefore it will default to RESP2. It's worth saying that there are plans to implement RESP3 in a future version but these changes are just being discussed and there is no planned release date yet.
So there is no immediate need to update the NuGet package of StackExchange.Redis because the underlying protocol has not changed.
I would also recommend asking for Sitecore Support advice before upgrading any dependencies of Sitecore internal libraries. If there are any non-compatibal changes in methods signature in newer versions of StackExchange.Redis, you may break internal Sitecore code that relies on this library.
| For upgrading Azure cache for redis 4 to 6 , Do we need update NuGet Package of StackExchange.Redis also
For upgrading the Azure cache for Redis v4 to v6, Do we need to update the NuGet Package of StackExchange.Redis also
| |
Here is something similar you will find in the below thread where they have created a script that displays all the sites in IIS and you pick the one to update.
The script changes out the cert in the bindings and updates the thumbnails where needed in the config.
The script is too long so I am not adding this to this answer, You can download the file using the below link.
https://community.sitecore.com/community?id=community_question&sys_id=66ab9a391be2c19038a46421b24bcbe4
Change the extension from .txt to .ps1
Hope this will solve your issue.
| Is it possible to renew certificates for local environment using SIF or CLI?
As my self-signed certificates for Sitecore 10.0 instance expired, I want to use SIF or CLI to renew them and best also to replace thumbprints to minimize manual work.
Is this possible with SIF or CLI?
Or is there any ps1 script I could use?
| |
JSS forms use form state to send data back to the server. This data is not updated automatically from all fields on your form.
In order to update the form state, you need to add onChange handler to your custom field implementation. For example, you can look at any field template.
# Callback for when the value of the form field changes. Will cause the parent form state and value prop to be updated.
onChange={(e) => handleOnChange(field, e.target.value, onChange)}
Your code should look like:
import { handleOnChange } from './helpers/commonChangeHandler';
const myCustomFormFactory = createDefaultFieldFactory();
myCustomFormFactory.setComponent('{287FA40A-C552-4B51-A59F-3EC0CE4906DB}', (props) => {
//Some other code
return (
<fieldset ref={formFieldRef}>
<label for={`${props.field.valueField.id}`} class=""></label>
<textarea id={`${props.field.valueField.id}`} name={`${props.field.valueField.name}`} onChange={(e) => handleOnChange(props.field, e.target.value, props.onChange)}/>
</fieldset>
);
});
| Sitecore Forms with JSS, Custom Fields Submit Payload is not showing value
We have created a custom field for Sitecore Forms using JSS react. In the JSS file, we are using CustomFormFactory to render the input on the front-end side -
const myCustomFormFactory = createDefaultFieldFactory();
myCustomFormFactory.setComponent('{287FA40A-C552-4B51-A59F-3EC0CE4906DB}', (props) => {
//Some other code
return (
<fieldset ref={formFieldRef}>
<label for={`${props.field.valueField.id}`} class=""></label>
<textarea id={`${props.field.valueField.id}`} name={`${props.field.valueField.name}`}/>
</fieldset>
);
});
The above code is working fine and showing the correct DOM on the FED side -
But when we are clicking on submit button after adding some text value in the custom field it is not adding this value in our payload of Post Method and BED side we are not able to see the value for the custom field and because of this validation always fails. so in the payload of the post method, we can see the field but its value is empty -
Did anyone create a custom field with Sitecore JSS using react?
Sitecore version - Sitecore.NET 10.3.0 (rev. 008463)
No error on logs and console.
| |
It is correct that getStaticProps DOES in fact not validate a page that it receives an error on. The issue is that Sitecore swallows the errors that occur within components:
Therefore, when getStaticProps finishes executing the page, it assumes all is well and thus you get a page with missing content/components.
Luckily, this is easily solvable because the error is accessible in the componentProps property of props. Also, since getStaticProps implements the SitecorePagePropsFactory, we can add an additional plugin without disturbing the existing code.
Add the following code under
lib
page-props-factory
plugins
Name: fail-on-component-error.ts
import { SitecorePageProps } from 'lib/page-props';
import { Plugin } from '..';
class FailOnComponentErrorPlugin implements Plugin {
order = 2;
async exec(props: SitecorePageProps) {
const componentErrors = Object.keys(props?.componentProps ?? {})
?.filter((component) => (props?.componentProps?.[component] as { error: string })?.error)
.map((key) => `${key}: ${(props?.componentProps?.[key] as { error: string })?.error}`);
if (componentErrors.length > 0) {
throw new Error(
`[GET STATIC PATHS]. An error occurred processing ${
props?.layoutData?.sitecore?.route?.name
}, message: ${componentErrors.join(' .. ')}`
);
}
return props;
}
}
export const failOnComponentErrorPlugin = new FailOnComponentErrorPlugin();
This code will cycle through the componentProps collection to find any components that are outputting an error. It then concatenates the unique rendering ID's and error messages into a single output.
This will not only stop builds from succeeding on errors, but also revalidation (ISR or On-Demand Revalidation).
| Next.js, Pages Still Generated When Components Error
We have a Next.js implementation on Vercel connected to Experience Edge. We noticed that when components error out, the page that contains the component is still generated. This results in public-facing pages with chunks of missing content. Next.js builds the entire page but where the component is supposed to go is entirely blank.
Instead of considering a page valid, we instead want the page to fail validation and not generate/regenerate. At times the failure is mundane, such as the connection to Edge getting dropped momentarily. Instead of generating a half-baked version of the page, we would much prefer to keep the original copy of the page up.
Next.js revalidation is supposed to work this way. When it experiences an error, it should not validate a page, but with the Sitecore Next.js SDK it does.
Is it possible to skip validating a page when a component errors?
Sitecore-jss-nextjs: ^20.1.3
Next: ^12.3.3
| |
I achieved this by writing a custom processor in the "GetPageEditorNotificationsProcessor" pipeline.
This will be called every time a user opens Experience Editor mode.
In the processor I updated the registry key to show shared layout and also added a notification message for user if they open final layout.
Code of the processor:
public class SetExperienceEditorLayout : GetPageEditorNotificationsProcessor
{
public override void Process(GetPageEditorNotificationsArgs arguments)
{
Assert.ArgumentNotNull(arguments, "arguments");
bool editingSharedVersion = WebUtility.IsEditAllVersionsTicked();
if (!editingSharedVersion)
{
arguments.Notifications.Add(new PageEditorNotification("You are editing the final layout"), PageEditorNotificationType.Warning));
Registry.SetString(Constants.RegistryKeys.EditAllVersions,
Constants.Registry.CheckboxTickedRegistryValue);
}
}
Config to patch the processor:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<pipelines>
<group groupName="ExperienceEditor" name="ExperienceEditor">
<pipelines>
<getPageEditorNotifications>
<processor patch:after="processor[@type='Sitecore.ExperienceEditor.Pipelines.GetPageEditorNotifications.LanguageAccessNotification, Sitecore.ExperienceEditor']" type="MyProject.Sitecore.Pipeline.SetExperienceEditorLayout, MyProject.Sitecore" />
</getPageEditorNotifications>
</pipelines>
</group>
</pipelines>
</sitecore>
</configuration>
| Always open shared layout while using experience editor sitecore 10.1.1
We want to always open shared layout in experience editor for our authors. We are using Sitecore 10.1.1.
As we have Sitecore 10.1.1 with azure ad login integration so, solution provided in link does not help:
Force shared layout in experience editor
Sitecore stores the user selection of layout in registry key EditAllVersions, I tried the solution provided in link:
https://blogs.perficient.com/2021/05/09/manage-users-registry-settings-after-login/
to always set the key EditAllVersions to on each time user logins.
But my custom Processor is not getting called every time when I login to Sitecore so the value of registry key ("{ "/Current_User/Page Editor/Show/EditAllVersions", "on" }") does not get updated. I am patching my processor after: "Sitecore.Owin.Authentication.Pipelines.CookieAuthentication.SignedIn.CleanupUserProfile" as mentioned in solution.
Any ideas what I am missing out here?
| |
When you use syncMaster strategy for sitecore_master_index, every time you save something in master database (or Sitecore itself saves a page, like e.g. information about last execution or scheduled job, changing the state of EXM message, any datasource change), a new backed job is created to updated sitecore_master_index.
By default Sitecore does not allow to update same index in parallel. It means that when your sitecore_master_index is being fully rebuilt, for like 12 minutes - as on your screenshot, all the partial updates of index triggered by updates of single items, they will be queued.
So in summary: every queued job you see there means that there was a save of a Sitecore item in master database during the time your sitecore_master_index was being rebuilt.
| Multiple Master_Index entries are coming on job queue on full reindexing the Sitecore_Master_Index
At the time of sitecore_master_index rebuild (full reindexing or on update) we can see multiple sitecore_master_index entries in the index job queue. Can anyone explain the reason for this?
url : websiteurl/sitecore/admin/jobs.aspx
| |
You can use item.Versions.RemoveAll() method.
Language languageRemove = Sitecore.Globalization.Language.Parse(languageCode);
Item rootItem = db.GetItem(rootItemPath, languageRemove);
if (rootItem != null)
{
using (new Sitecore.SecurityModel.SecurityDisabler())
{
//Remove all the versions from item
rootItem.Versions.RemoveAll(false);
}
}
| Delete all numbered version of a specific language version using c#
I have to delete the language version of a Sitecore item. For Ex. if it has 5 numbered versions in the English language so I have to delete all 5 at once.
I have tried by item.Versions.RemoveVersion(); but it deletes only one numbered version. Is there any other method available for this?
| |
That must be an issue with upgrading from older version of Sitecore.Forms.Extensions to the newer version.
In Sitecore.Forms.Extensions for Sitecore 9.0 there was a config file App_Config/Include/Feature/FormsExtensions/Feature.FormsExtensions.ApiServices.config. It referenced Feature.FormsExtensions.Controllers.FieldBindingMapApiController as allowedController.
That config file is no longer there in newer version at all. So if you upgraded, the file was never overwritten with new version of that file and it's still there, trying to use FieldBindingMapApiController which is not there in new dll.
Just remove App_Config/Include/Feature/FormsExtensions/Feature.FormsExtensions.ApiServices.config file.
| Failed to load Feature.FormsExtensions.Controllers.FieldBindingMapApiController
ERROR [Sitecore Services]: Failed to load Feature.FormsExtensions.Controllers.FieldBindingMapApiController, Feature.FormsExtensions
Does anyone know what this error means? I'm using Sitecore FormsExtensions version sc10.1-4.0.2 on Sitecore 10.2. The documentation site for this extensions is offline. The source code only references FieldBindingMapApiController in the readme for version 1.4.1
Here is the repo for Sitecore Forms Extension
| |
The reason for this error is a missing callback function that should be called once the reCaptcha control is loaded. The function name is specified in the script tag:
<script src="https://www.google.com/recaptcha/api.js?onload=loadReCaptchas ...
In previous versions of Sitecore Forms Extensions the callback function was defined in the same ReCaptcha.cshtml file as the field HTML markup. Starting from version 9.2 this function exists in the file /sitecore%20modules/Web/ExperienceForms/scripts/formsextensions.validate.js and it looks like the browser can't find this function on your page.
Please check the following potential reasons:
You should see that the JavaScript file /sitecore%20modules/Web/ExperienceForms/scripts/formsextensions.validate.js loads correctly in the Network tab of browser Developer Tools. If this file does not exist or the request blocked, it will trigger this error.
If the JavaScript file is loaded correctly, make sure that it is not cached and contains the function loadReCaptchas. You can compare your file with the correct version in GitHub.
If you do not see any request to formsextensions.validate.js and there is no such <script> tag in the raw HTML output of you page, check that the processor Feature.FormsExtensions.Fields.JavascriptLoader and the config Feature.FormsExtensions.Processors.config are included in your Sitecore configs folder. Your page layout file should also contain the helper @Html.RenderFormScripts() before the closing </body> tag to include the necessary scripts for forms.
| Recaptcha control not loading on Sitecore 10.2
Getting the following in the dev tools console and the recaptcha control is not rendering.
reCAPTCHA couldn't find user-provided function: loadReCaptchas
Recently upgraded from Sitecore 9.0.2 to 10.2. We upgraded the Sitecore Forms Extensions to version sc10.1-4.0.2. The ReCaptcha control will not load. On Content Management servers I am able to view the ReCaptcha image but the control itself will not load when viewing the form on a page.
When debugging, the output from the Recaptcha.cshtml looks like the following:
<div id="fxb_fe2d6775-2160-428c-9065-8e3f7565b206_Fields_d4073a01-591d-4e0d-8d09-2dc6d78e83a4__CaptchaValue_wrapper"></div>
<input id="fxb_fe2d6775-2160-428c-9065-8e3f7565b206_Fields_d4073a01-591d-4e0d-8d09-2dc6d78e83a4__CaptchaValue" name="fxb.fe2d6775-2160-428c-9065-8e3f7565b206.Fields[d4073a01-591d-4e0d-8d09-2dc6d78e83a4].CaptchaValue" type="hidden" class="fxt-captcha" data-val-required="Please confirm you are not a robot." data-val="true" />
<span class="field-validation-valid" data-valmsg-for="fxb.fe2d6775-2160-428c-9065-8e3f7565b206.Fields[d4073a01-591d-4e0d-8d09-2dc6d78e83a4].CaptchaValue" data-valmsg-replace="true"></span>
<script type="text/javascript">
var reCaptchaArray = reCaptchaArray || [];
reCaptchaArray.push(
function() {
var _captchaInput = window.document.getElementById('fxb_fe2d6775-2160-428c-9065-8e3f7565b206_Fields_d4073a01-591d-4e0d-8d09-2dc6d78e83a4__CaptchaValue');
window.grecaptcha.render('fxb_fe2d6775-2160-428c-9065-8e3f7565b206_Fields_d4073a01-591d-4e0d-8d09-2dc6d78e83a4__CaptchaValue_wrapper',
{
'sitekey': 'REMOVED-PROPERLY-ADDED',
'callback': function(token) {
_captchaInput.value = token;
},
'expired-callback': function(args) {
_captchaInput.value = '';
}
});
}
);
</script>
<script src="https://www.google.com/recaptcha/api.js?onload=loadReCaptchas&render=explicit&hl=en" async defer></script>
Any hints on what could be preventing the control from loading properly?
screenshot of the message in Console:
| |
You make request from Sitecore container. localhost on the Sitecore container is not equal to localhost on your local machine.
Localhost inside container is this container address.
You can't request from the Docker container your sites that are hosted on your machine. What you can do: setup rendering host container inside your Docker network and change http://localhost:3000/api/editing/render to the address of your rendering host container, e.g. http://localhost:3000/api/editing/render
| ERROR [JSS] Error occurred during POST to remote rendering host: `http://localhost:3000/api/editing/render`
We are running Next.js JSS app using XM Cloud docker setup, our localhost:3000 site is loading, but when we are trying to run Experience Editor it is giving 2 erros.
On First Try we are getting below error:
A Sitecore.JavaScriptServices application was not found for the path {itempath}. You should ensure that:
* You have applied a Sitecore configuration patch for the application (see App_Config\Sitecore\JavaScriptServices\Sitecore.JavaScriptServices.ExampleApp.config.example)
> * The path represents a Route
* The Route item is a descendant of an App item
If I change the URL with query string sc_site to sc_jssapp it is giving us below error
2836 06:24:55 ERROR [JSS] Error occurred during POST to remote rendering host: `http://localhost:3000/api/editing/render`
2836 06:24:55 ERROR Unable to connect to the remote server
Exception: System.Net.WebException
Message: Unable to connect to the remote server
Source: System
at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)
at System.Net.WebClient.UploadString(Uri address, String method, String data)
at Sitecore.JavaScriptServices.ViewEngine.Http.RenderEngine.Invoke[T](String moduleName, String functionName, Object[] functionArgs)
Nested Exception
Exception: System.Net.Sockets.SocketException
Message: No connection could be made because the target machine actively refused it 127.0.0.1:3000
Source: System
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
We have already checked JSS_Editing Secret in .env file and Sitecore config.
| |
It depends. If you want to take changes to only master, web and core database then yes use vanilla databases for other Dbs.
But if you want to keep changes in Analytics data then there are separate steps to upgrade Analytics DB (xDB). For reference use the this - How to handle xDB during a Sitecore upgrade?
If you want to keep Reference DBs updates then there are other steps to upgrade that DB. For reference use this - https://www.maartenwillebrands.nl/2022/03/15/sitecore-speeding-up-the-upgrade-process-for-the-reference-data-database/
To upgrade the xDB Reference Data database:
Run the SXP_referencedata_Part1.sql script.
Review the results of running the script. If you receive the following message:
Definitions cannot be migrated. Length of # definition monikers exceeds 300 characters.
Consider truncate, change or remove them. Upgrade stopped. Fix all the issues and run this
script again. Upgrade (part 1) has not been completed.
Fix all the issues as described in this message and run the
SXP_referencedata_Part1.sql script again.
Repeat this step until you receive the Upgrade (part 1) has been done successfully.
message.
Run the SXP_referencedata_Part2.sql script
So it totally depends on the business decision. Generally, we just need to upgrade master, core databases if the client doesn't want to have analytics then we keep new one as is.
For more reference you can see the blog
And in Sitecore 10.2 upgrade guide, you can find each information in details -
| Which databases should be replaced in connectionstrings when upgrading?
I'm upgrading from Sitecore 9.3 to 10.2.
As per the documentation, I ran some upgrade scripts for some of the databases (e.g. core, master, web, and others), and some other databases didn't require an upgrade script (e.g referencedata, processingenginestorage, exmmaster)
The documentation mentioned in 3.2.2
connect the new Sitecore XP instance to the databases from previous Sitecore XP version that you upgraded in the previous chapter.
so my understanding is that I should only connect 9.3 databases to my new 10.2 instance that had any upgrade script run on them, and keep using the new 10.2 databases for any DBs that had no upgrade script run on them.
However, when I checked the contents of the 9.3 referencedata database for example, I found that there is some data there, wouldn't that mean this data will be lost if I use the new 10.2 referencedata DB?
My question is mainly: which databases should be replaced with the upgraded databases in the connectionstrings.config file when we are upgrading, and which ones should be left to reference the fresh 10.2 instance databases?
| |
You just need to login into your Sitecore instance by running the following command from your project root folder.
dotnet sitecore login --authority "https://your.id.host" --cm "https://your.cm.host" --allow-write true
Flags explanation
--auth, --authority Identity authority for the environment, i.e. identity server or AAD tenant URL
--cm Sitecore content management hostname to connect to
--allow-write Enables writing data to the environment
| Error invalid_grant when trying to serialize items with Sitecore cli
I'm working on dockerized Sitecore 10.3 solution with JSS and SXA but when I run the below command to serialize my items from Sitecore I get the error invalid_grant.
command
dotnet sitecore ser pull
Error
This was working nicely and stopped working suddenly.
| |
Is this after an upgrade perhaps? The FormsExtensions work quite differently for emails in the latest version.
Anyway, what you should verify in any case:
on the form in the submit action make sure the tokens section is filled correctly:
the all fields token checkbox must be checked if you want to work with the $AllFormFields$ token
for each field you want as a token, you must add the token_name and form field
in the email, you can use tokens like $form_first_name$ (or the $AllFormFields$ if that was checked)
| Unable to send emails via EXM using sitecore forms extensions
Getting the following error on EXM log when submitting a form with Send Email with Exm submit step using Sitecore FormsExtensions sc10.1-4.0.2 on Sitecore 10.2.0
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Feature.FormsExtensions
at Feature.FormsExtensions.SubmitActions.SendEmail.Tokens.MailTokenBuilder.BuildTokens(IDictionary`2 fieldTokens, FormSubmitContext formSubmitContext)
at Feature.FormsExtensions.SubmitActions.SendEmail.SendEmailBase`1.BuildCustomTokens(T data, FormSubmitContext formSubmitContext)
at Feature.FormsExtensions.SubmitActions.SendEmail.SendEmailExtended.BuildCustomTokens(SendEmailExtendedData data, FormSubmitContext formSubmitContext)
at Feature.FormsExtensions.SubmitActions.SendEmail.SendEmailBase`1.Execute(T data, FormSubmitContext formSubmitContext)
User sees this on the front-end:
Things I have tried without resolve:
Republish everything under sitecore/content/email tree
Reindex sitecore/content/email and sitecore/forms trees
republish the whole site
Reinstalling the Sitecore FormsExtensions sc10.1-4.0.2
The workaround has been to change the email message attached to this step, publish form. Come back and assign it the previous message and publish again. Form successfully submits.
I'm assuming the field tokens are null - what are field tokens? Any hints on what could cause this issue?
| |
The API endpoint you are using appears to be correct, but there are a few things that could be causing issues with your authentication request:
When requesting a token from the Content Hub API, you should use the /oauth/token endpoint and set the request method to POST. Additionally, the Content-Type header should be set to application/x-www-form-urlencoded. The client_id value should match the API key name you created in Content Hub, and the grant_type value should be set to password. The username and password should be provided in the request body as username and password parameters, respectively.
You can read more in this specification and in Sitecore documentation.
The client_id value should be the client ID of the API key you created in Content Hub. You can find this ID by navigating to the "API Keys" section in Content Hub and clicking on the key you created. The client ID will be listed on this page.
The API key can be either scoped or global, but it needs to have the appropriate permissions to access the resources you are trying to retrieve via the API. Make sure that the API key has the necessary scopes and permissions.
The user whose credentials you are using to authenticate should have the necessary permissions to access the resources you are trying to retrieve via the API. The user does not necessarily need to be a superuser, but they do need to have the appropriate permissions.
Below the CULR that can be imported into Postman for future usage:
curl -X POST -u "{{client_id}}:{{secret}}" \
http://marketingcontenthub/oauth/token \
-d grant_type=password -d username={{username}} -d password={{password}}
How to get {{client_id}} and {{secret}}:
Log in to your Content Hub account.
Go to the Admin section.
Click on the OAuth Clients tab.
Click on the Create New button.
Enter a name for the client.
Select the appropriate grant types.
Add the necessary redirect URIs.
Click on the Create button.
You will now see the Client ID and Client Secret for your OAuth client. Then you can set it in Postman Environment variables.
After importing you need to set all variables in Postman accordingly or replace tokens with actual values.
| How to use the REST API to fetch data from Content Hub using Postman
Using Content Hub v4.2
I would like to fetch the data in Content Hub using the REST API, but couldn't find any Postman related examples.
I tried this to get the token with no luck.
Is it the right API end point?
What should be the client_id. I just used the same name I gave when creating the API key in Content Hub.
Should the API key be Scoped or global?
When giving the username & password of a user, should that user be a superuser?
Here is a link of documentation for old version but the Postman collections seems to no longer exist.
https://doc.sitecore.com/ch/en/developers/30/cloud-dev/rest-api--about.html
And since then any newer version doesn't mention about a Postman collection.
UPDATE:
I have modified the Content-Type and it now says Invalid client_id. I have created a new global API key api_test.
| |
The steps I took to resolve:
ILSpy find the source of the error - it is coming from Sitecore.ExperienceEditor.Web.ResourceCollector.SessionResourceCollector looking for EE js files - noted a way to disable this with WebEdit.EnableJSBundling false - tested that which made it fast but the EE is broken with JS errors
Sitecore.ExperienceEditor.Speak.Ribbon.RibbonComponentControlBase is the one adding a PageCodeScriptFileName. To me this means there is an ribbon component that is not correctly configured. Considering that this issue is recent , might be a core DB upgrade issue or maybe an issue with a custom module.
I notice we have 2 custom modules - Global Link and KeyStone on the ribbon. Likely one of these is not configured right.
Try and click on Global Link and KeyStone ribbons icons - these are triggering a 404 on js files!
After checking requirements, we don't actually need these modules anymore.
Deleted core:/sitecore/content/Applications/WebEdit/Ribbons/WebEdit/Global Link and
core:/sitecore/content/Applications/WebEdit/Ribbons/WebEdit/Keystone - Issue resolved!
I hope this helps others if they have a similar issue.
| Experience Editor is very slow to load the Ribbon.aspx, logs show WARN Cannot resolve resource item
After a Sitecore upgrade, the EE is very slow to load the Ribbon.aspx page.
The logs are showing WARN Cannot resolve resource item but there is no other indication as to what the issue is.
I realise this is somewhat an upgrade specific issue but the log message indicates it is somewhat platform related and therefore is possibly an issue that multiple people might get.
| |
I have raised a support ticket with Sitecore and the 2nd approach they have suggested, worked for me.
Approach 1:
If you already know the ID of the collection, you can directly use
/api/entities/{id}/relations/ContentCollectionToContent
That output does not contain the items, this is because a ContentCollection can contain a lot of Content and the API returns a list of Content that are in the Collection. To get the information, you will need to navigate to the href and it will have the full data of a singular Content.
If you do not know the ID and require search, then:
/api/entities/query?query=(Definition.Name == "M.ContentCollection" AND String('ContentCollectionName')=='McDonalds Content Collection')
When you retrieve this result, you can get the ID then run the query
api/entities/{id}/relations/ContentCollectionToContent
Approach 2:
You can also do a reverse query on M.Content to find all M.Content in a specific ContentCollection. This also requires you to know the ID of the ContentCollection.
For example:
/api/entities/query?query=(Definition.Name == "M.Content" AND Parent('ContentCollectionToContent').id=={id})
In order to get only "Blogs" or "Advertisements", you could use the same query but append the condition
AND Parent('ContentTypeToContent').id=={id}
where ID is equal to the ID of the Content Type. 9786 for Blog and 9792 for Advertisement.
The related documentation is in https://doc.sitecore.com/ch/en/developers/42/cloud-dev/rest-api--query.html
All queries start with
http://<hostname>/api/entities/query/
Then you can append the query depending on what you need such as Properties, Specific system properties and other parameters such as Relations, Operators and furthermore.
The query provided
/api/entities/query?query=(Definition.Name == "M.Content" AND Parent('ContentCollectionToContent').id=={id})
is used to search for all entities with M.Content as definition AND we are searching all entities that have the relation ContentCollectionToContent == id
Further, I had also requested more info about Selection API's documentation for which Sitecore has responded
Regarding the api/selection that you have mentioned, we are sorry to
inform you that the docs are outdated and this is not supported
anymore. We have raised a request to the team to change the
documentation.
Regarding the documentation, this was missed when the functionality of
the product was changed. We will provide feedback to the documentation
team regarding this.
| How to fetch all items from a Content Collection
Using Content Hub (CH) v4.2
I have created a Content Collection called "McDonalds Content Collection" which has an item of Content Type Advertisement.
Now, I would like to fetch all the data/items from the respective collections, For e.g., I want to get all the Advertisements and their data (Title, Image, Description) from "McDonalds Content Collection".
Or just all items in that collection with their details.
Here is my API query:
https://{{hostname}}/api/entities/query?query=Int('id')==93451
93451 is the ID of my Collection item/folder.
This query returns information about the collection and not the items inside it. What should be the query to get only the data inside the collection.
Response
{
"items": [
{
"id": 93451,
"identifier": "LtgrELltiUyy8kRysWqNmA",
"cultures": [
"en-US"
],
"properties": {
"ContentCollectionName": "McDonalds Content Collection",
"ContentCollectionDescription": null,
"PreventPublish": null,
"PublishStatus": {
"identifier": "Published",
"labels": {
"en-US": "Published"
}
},
"PublishStatusDetails": null
},
"relations": {
"RoleProxyToContentCollection": {
"href": "https://example.com/api/entities/93451/relations/RoleProxyToContentCollection"
},
"ContentCollectionToMasterAsset": {
"href": "https://example.com/api/entities/93451/relations/ContentCollectionToMasterAsset"
},
"ContentRepositoryToContentCollection": {
"href": "https://example.com/api/entities/93451/relations/ContentRepositoryToContentCollection"
},
"StatusToContentCollection": {
"href": "https://example.com/api/entities/93451/relations/StatusToContentCollection"
},
"MContentCollectionToAvailableRoute": {
"href": "https://example.com/api/entities/93451/relations/MContentCollectionToAvailableRoute"
},
"MContentCollectionToActiveState": {
"children": [
{
"href": "https://example.com/api/entities/29917"
}
],
"inherits_security": true,
"self": {
"href": "https://example.com/api/entities/93451/relations/MContentCollectionToActiveState"
}
},
"ContentCollectionToContent": {
"href": "https://example.com/api/entities/93451/relations/ContentCollectionToContent"
},
"MContentCollectionToStateMachine": {
"href": "https://example.com/api/entities/93451/relations/MContentCollectionToStateMachine"
}
},
"created_by": {
"href": "https://example.com/api/entities/92202",
"title": "The user who created the entity"
},
"created_on": "2023-03-13T07:12:09.5920623Z",
"modified_by": {
"href": "https://example.com/api/entities/92202",
"title": "The user who last modified the entity"
},
"modified_on": "2023-03-13T07:13:04.818515Z",
"entitydefinition": {
"href": "https://example.com/api/entitydefinitions/M.ContentCollection",
"title": "The entity definition for this entity"
},
"copy": {
"href": "https://example.com/api/entities/93451/copy",
"title": "Copy this entity"
},
"permissions": {
"href": "https://example.com/api/entities/93451/permissions",
"title": "The permissions on this entity"
},
"lifecycle": {
"href": "https://example.com/api/entities/93451/lifecycle",
"title": "The lifecycle action for this entity."
},
"saved_selections": {
"href": "https://example.com/api/entities/93451/savedselections",
"title": "The saved selections this entity belongs to"
},
"roles": {
"href": "https://example.com/api/entities/93451/roles",
"title": "Roles for this entity"
},
"annotations": {
"href": "https://example.com/api/entities/93451/annotations",
"title": "Annotations for this entity"
},
"is_root_taxonomy_item": true,
"is_path_root": false,
"inherits_security": true,
"is_system_owned": false,
"version": 5,
"self": {
"href": "https://example.com/api/entities/93451"
},
"renditions": {}
}
],
"total_items": 1,
"returned_items": 1,
"self": {
"href": "https://example.com/api/entities/query?query=Int(%27id%27)%3D%3D93451",
"title": "This collection"
}
}
| |
I noticed the same issue already in Sitecore 10.1.
To answer your questions:
The fact that owner field is empty does NOT have impact on security. The owner field of contact list is not related in any way to access rights.
Owner field is used when displaying My Lists in List Manager - Sitecore will show all the lists created by given user or which have Owner field equal to current user name (including sitecore\ domain, e.g. sitecore\marekmusielak).
Owner field can be populated manually in Content Editor - find your contact list item under /sitecore/system/Marketing Control Panel/Contact Lists/ and fill Owner field in Data section:
| List Manager Owner Field
I am using Sitecore 10.2, when creating contact list I found the owner field drop down is not populated.
I want to know how I can populate it and does it have affect on the security access of the list?
Any advise
| |
When moving to Sitecore XM/XP 10.1+ you'll want to consider newer options available. In your case, you may find that ItemsAsResources (IAR) is an ideal approach to solving the issue of moving developer-owned items through environments.
The Sitecore CLI includes a plugin for generating the IAR files.
I blogged about some of my experience transitioning from a deployment that synced YAML items to using the IAR files. It has its quirks but is a good alternative.
| Alternatives to SitecorePackageDeployer
We're upgrading to Sitecore 10.2, and have previously used Sitecore Package Deployer in a previous version of Sitecore in our CI/CD process. I noticed this package has not been updated since 2019, and the docs say it's only been tested up to v9.0. Is there a different or better process to handle this in 10.x? Thanks!
| |
Having looked at Sitecron module code, I found that there is no out-of-the-box setting that can enable or disable creation of execution reports.
One possible way to prevent creation of execution reports without code changes is to make sure that executionReportFolderItem is null in the method CreateExecutionReport() and the code within condition if (executionReportFolderItem != null) is not executed (see code of the method CreateExecutionReport() below).
You can achieve this either by removing the item with ID {E62862B1-03DF-4752-A290-9B505806C515} or denying read permission to this item for the user account that creates execution reports.
private void CreateExecutionReport(string jobName, ID itemID, string logData, string lastRunTime)
{
try
{
string contextDbName = Settings.GetSetting(SitecronConstants.SettingsNames.SiteCronContextDB, "master");
Database contextDb = Factory.GetDatabase(contextDbName);
//The bucket is not publishable so it will stay only on the master. This way it will not cause any publishing delays.
Item executionReportFolderItem = contextDb.GetItem(new ID(SitecronConstants.ItemIds.SiteCronExecutionReportsFolderID));
if (executionReportFolderItem != null)
{
string newItemName = ItemUtil.ProposeValidItemName(string.Concat(jobName, DateTime.Now.ToString(" dddd MMMM dd yyyy HH mm ss ffff")));
using (new SecurityDisabler())
{
Item executionReport = executionReportFolderItem.Add(newItemName, new TemplateID(SitecronConstants.Templates.SiteCronExecutionReportTemplateID));
if (executionReport != null)
{
executionReport.Editing.BeginEdit();
{
executionReport[SitecronConstants.FieldNames.LastRunUTC] = lastRunTime;
executionReport[SitecronConstants.FieldNames.Log] = logData;
if (!ID.IsNullOrEmpty(itemID))
executionReport[SitecronConstants.FieldNames.SitecronJob] = itemID.ToString();
}
executionReport.Editing.EndEdit();
}
}
}
}
catch (Exception ex)
{
Log.Error("SiteCron ERROR creating Execution report: " + ex.Message, ex, this);
}
}
| How to disable Sitecron execution reports
I was looking for a way to disable the Sitecron execution reports. I could not find any setting in the config file that could do this.
So has anyone tried disabling the execution report generation? Is there any way to disable it out of the box?
| |
If you are utilizing the shared site concept of SXA, please ensure that none of your Site node and Site Dictionary Folder are set to the "Never Publish" state. If they are, it may have an impact and lead to issues with the "sc_translate" functionality.
I encountered a similar issue in one of my projects, and this approach resolved it.
| Object reference not set to instance in preview mode for sc_translate
I am getting object reference not set to instance at sc_translate in preview mode
When i checked the scriban loc (10,57), it is sc_translate
What can be the possible reason for this?
| |
You need to add it to the layout file like.
<html lang="@Sitecore.Context.Language.CultureInfo.TwoLetterISOLanguageName">
Refer: https://github.com/Sitecore/Habitat/blob/master/src/Project/Habitat/code/Views/Website/Layouts/Default.cshtml
| How to add language code in html tag
It might sound simple question as I am new into Sitecore. I need to add two characters of language code into html tag for site web accessibility.
Working with Sitecore 9.3
Thanks in advance.
| |
In addition to @Anton answer,
Sometimes site resolving logic might seem to work in unexpected ways (for example, when opening items in the Experience Editor or in the Preview mode), but in fact, the behavior is affected by special configuration settings that can be changed according to your requirements.
It is recommended to keep the Rendering.SiteResolving setting value at true for any multisite solution in order to ensure that cross-site links are built with the correct parameters.
Here, the Experience Editor and Preview mode is opened in the context of the site defined in the Preview.DefaultSite setting.
In my case, I observed the page preview mode was throwing an error, and when I looked into the Preview.Default setting in Sitecore.config file, it was pointing to website.
So, there are two options you can try here to resolve this issue:
Update the “website” site node start item in Sitecore.config to point to active site/ location or
Update the Preview.DefaultSite mode settings with an active site.
Note:
Please make any updates to Sitecore.config using Sitecore patch file, so that we don’t mess up anything with the default configurations, and down the line didn’t face any issue with Sitecore upgrade as well.
Also, to make sure that items are opened in context of correct site, we must set the Rendering.SiteResolvingMatchCurrentSite setting to true
All configs related to site resolving can be found (/App_Config/Sitecore.config)
Please read more about the site resolving here- https://kb.sitecore.net/articles/986056
Hope it helps!
| What is the difference between site running from master DB and site in preview mode?
What is the difference between the following scenarios:
Experience Editor - page in edit mode fetching content from master DB
Preview mode - page from master DB
Site running from master DB - master DB is used, take publishing restriction and workflow into consideration
I am getting the error "Object reference not set to instance" in the preview mode and everything is working well in EE and site connected the master DB. I need to understand what is different in the preview mode.
It is related to this question: Object reference not set to instance in preview mode for sc_translate
| |
The answer proved to particular to Sitecore 10.2 (My mistake was I had been looking at a 9.3 guide).
https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-manager/create-a-publishing-target.html
Key steps in the above article are:
In the App_Data\items\ folder, make a copy of the Web folder.
Rename the copy of the folder and the .dat file inside it. Use the database name for the folder (for example, web_preview) and use the database name within the file name, so it is similar to items.web_preview.dat).
Once those files were created the new target began working as expected.
| New Publishing Target database not populating when published to
I've created a new Publishing Target and associated database, but I've run into an issue that I can't seem to solve. The new target, "review", is present but won't populate on Publish. On performing a full Site Republish, it shows no errors but simply returns:
Job started: Publish to 'review'
Items created: 0
Items deleted: 0
Items updated: 0
Items skipped: 2
Job ended: Publish to 'review' (units processed: 2)
(Doing a Republish on the Home node with sub-items/related included is the same except it reports skipping 57 items)
This is configuration file for adding the DB. The DB itself was created as a copy of Web. Inspecting the review database directly after the publish there are just 11 rows in the dbo.Items table (down from the 1000+ that were present before attempting a publish):
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:security="http://www.sitecore.net/xmlconfig/security/">
<sitecore>
<eventing>
<eventQueueProvider>
<eventQueue name="review" patch:after="eventQueue[@name='web']" type="Sitecore.Data.Eventing.$(database)EventQueue, Sitecore.Kernel">
<param ref="dataApis/dataApi[@name='$(database)']" param1="$(name)"/>
<param ref="PropertyStoreProvider/store[@name='$(name)']"/>
</eventQueue>
</eventQueueProvider>
</eventing>
<PropertyStoreProvider>
<store name="review" patch:after="store[@name='web']" prefix="review" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.$(database)PropertyStore, Sitecore.Kernel">
<param ref="dataApis/dataApi[@name='$(database)']" param1="$(name)" />
<param resolve="true" type="Sitecore.Abstractions.BaseEventManager, Sitecore.Kernel" />
<param resolve="true" type="Sitecore.Abstractions.BaseCacheManager, Sitecore.Kernel" />
</store>
</PropertyStoreProvider>
<databases>
<!-- review -->
<database id="review" patch:after="database[@id='web']" singleInstance="true" type="Sitecore.Data.DefaultDatabase, Sitecore.Kernel" role:require="Standalone or ContentManagement or ContentDelivery">
<param desc="name">$(id)</param>
<icon>Images/database_web.png</icon>
<securityEnabled security:require="Sitecore">true</securityEnabled>
<securityEnabled security:require="None">false</securityEnabled>
<dataProviders hint="list:AddDataProvider">
<dataProvider type="Sitecore.Data.DataProviders.CompositeDataProvider, Sitecore.Kernel">
<param desc="readOnlyDataProviders" hint="list">
<protobufItems type="Sitecore.Data.DataProviders.ReadOnly.Protobuf.ProtobufDataProvider, Sitecore.Kernel">
<filePaths hint="list">
<filePath>$(dataFolder)/items/$(id)</filePath>
<modulesFilePath>/sitecore modules/items/$(id)</modulesFilePath>
</filePaths>
</protobufItems>
</param>
<param desc="headProvider">
<dataProvider ref="dataProviders/main" param1="$(id)">
<disableGroup>publishing</disableGroup>
<prefetch hint="raw:AddPrefetch">
<sc.include file="/App_Config/Prefetch/Common.config" />
<sc.include file="/App_Config/Prefetch/Webdb.config" />
</prefetch>
</dataProvider>
</param>
</dataProvider>
</dataProviders>
<PropertyStore ref="PropertyStoreProvider/store[@name='$(id)']" />
<remoteEvents.EventQueue>
<obj ref="eventing/eventQueueProvider/eventQueue[@name='$(id)']" />
</remoteEvents.EventQueue>
<archives hint="raw:AddArchive">
<archive name="archive" />
<archive name="recyclebin" />
</archives>
<cacheSizes hint="setting">
<data>100MB</data>
<items>50MB</items>
<paths>2500KB</paths>
<itempaths>50MB</itempaths>
<standardValues>2500KB</standardValues>
</cacheSizes>
<BlobStorage hint="raw:AddBlobStorage">
<providers default="classic">
<provider name="classic" type="Sitecore.Data.Blobs.ClassicSqlBlobProvider, Sitecore.Kernel">
<param desc="databaseName">$(id)</param>
</provider>
</providers>
</BlobStorage>
</database>
</databases>
</sitecore>
</configuration>
Publishing Log:
5244 12:35:13 INFO [Recovery]: Setting default publish recovery strategy.
5244 12:35:13 INFO [Recovery]: Publish Recovery Enabled - False
5244 12:35:13 INFO [Recovery]: Publish Recovery Strategy - DatabasePublishRecoveryStrategy
5244 12:35:13 INFO Settings.Publishing.CheckSecurity:False
5244 12:35:13 INFO Settings.Publishing.CompareRevisions:True
5244 12:35:13 INFO Settings.Publishing.DisableDatabaseCaches:False
5244 12:35:13 INFO Settings.Publishing.ExecuteInManagedThreadPool:False
5244 12:35:13 INFO Settings.Publishing.LogInterval:0
5244 12:35:13 INFO Settings.Publishing.MaxDegreeOfParallelism:1
5244 12:35:13 INFO Settings.Publishing.PublishDialogPollingInterval:500
5244 12:35:13 INFO Settings.Publishing.PublishEmptyItems:False
5244 12:35:13 INFO Settings.Publishing.PublishingInstance:[REDACTED]
5244 12:35:13 INFO Settings.Publishing.RequireTargetDeleteRightWhenCheckingSecurity:True
5244 12:35:13 INFO Settings.Publishing.StatusUpdateInterval:00:00:02
5244 12:35:13 INFO Settings.Publishing.ThreadPriority:BelowNormal
5244 12:35:13 INFO Settings.Publishing.TimeBeforeStatusExpires:02:00:00
4820 12:40:37 INFO [Publishing]: Starting to process 1 publishing options
4820 12:40:37 INFO [PublishOptions]: root:null, language:en, targets:Review, database:review, mode:Full, smart:True children:True, related:True
5340 12:40:37 INFO SitePublish detected. PublishContext was overridden with DisableDatabaseCaches=True.
5340 12:40:37 INFO Starting [Publishing] - AddItemsToQueue
5340 12:40:37 INFO Finished [Publishing] - AddItemsToQueue in 0 ms
5340 12:40:37 INFO Starting [Publishing] - ProcessQueue
5340 12:40:37 INFO Finished [Publishing] - ProcessQueue in 66 ms
5340 12:40:37 INFO Publish Mode : Smart
5340 12:40:37 INFO Created : 0
5340 12:40:37 INFO Updated : 0
5340 12:40:37 INFO Deleted : 0
5340 12:40:37 INFO Skipped : 2
Any and all help gratefully received!
| |
In the Leprechaun.config file, you'll see that the example above the metadata generator shows a "droptree". What "type" is referring to in this case is the Sitecore field type, not a C# class type
<fieldType id="{11111111-1111-1111-1111-111111111111}" type="droptree" />
In the csx file for your codegen template, there's a mapping of Sitecore field types to concrete classes: GlassMapper.csx (line 145). If the type doesn't match, it'll return string.
What you need to do is define a custom type on the fieldtype as you did above:
<fieldType id="{ae1b2067-94a6-4357-a997-00a5052a98fa}" type="associatebio" />
and then add a line in your GlassMapper.csx:
case "associatebio":
return "MySite.Feature.AssociateBio.I_AssociateBio";
| Leprechaun custom field mapping not working, always outputs field type as string
I'm using Leprechaun for code generation and the custom field mapping I'm trying to implement isn't working. The field is generated as type String in every case, so I know the custom mapping is failing but I do not know why. I've tried the following variations:
<metadataGenerator type="Leprechaun.MetadataGeneration.StandardTemplateMetadataGenerator, Leprechaun" singleInstance="true">
<fieldType id="{ae1b2067-94a6-4357-a997-00a5052a98fa}" type="I_AssociateBio" />
</metadataGenerator>
<metadataGenerator type="Leprechaun.MetadataGeneration.StandardTemplateMetadataGenerator, Leprechaun" singleInstance="true">
<fieldType id="{ae1b2067-94a6-4357-a997-00a5052a98fa}" type="MySite.Feature.AssociateBio.I_AssociateBio" />
</metadataGenerator>
<metadataGenerator type="Leprechaun.MetadataGeneration.StandardTemplateMetadataGenerator, Leprechaun" singleInstance="true">
<fieldType id="{ae1b2067-94a6-4357-a997-00a5052a98fa}" type="custom=MySite.Feature.AssociateBio.I_AssociateBio" />
</metadataGenerator>
I can tell that it's getting picked up, because firstly, the field is a Droplink so without the custom mapping it outputs as a Guid; and secondly, it shows the Field Type from my mapping in the metadata:
/// Represents Person field
/// <para>Field Type: custom=MySite.Feature.AssociateBio.I_AssociateBio</para>
/// <para>ID: {ae1b2067-94a6-4357-a997-00a5052a98fa}</para>
/// <para>Section: Employee Spotlight</para>
/// </summary>
[SitecoreField(FieldName = IEmployeeSpotlightConstants.Person_FieldName)]
string Person { get; set; }/// <summary>
I cannot get it to output MySite.Feature.AssociateBio.I_AssociateBio Person { get; set; }
I_AssociateBio is in another project, but it's referenced in the EmployeeSpotlight project, and when I manually change the type of the field to I_AssociateBio Person it's valid
| |
There are 2 parts to this answer. First, you can absolutely just create your component as you have it listed above. This would create you with 3 placeholder keys:
jss-sample-placeholder
jss-sample-placeholder1
jss-sample-placeholder2
You need to make sure that you create placeholder settings for these that match the keys and that your components have the placeholders assigned to them.
The only problem with the code you have, is that if you add the same component on the page more than once, the placeholder keys will conflict.
You need to add the Dynamic Placeholder Id to the placeholder key name. If you look at the OOTB Headless SXA Container component, you can see this done:
const phKey = `container-${props.params.DynamicPlaceholderId}`;
In your Placeholder Settings, your placeholder key names would become
jss-sample-placeholder-{*}
jss-sample-placeholder1-{*}
jss-sample-placeholder2-{*}
This now lets you add this component to the page multiple times without a placeholder key conflict.
| Sitecore Jss with Next Js : How to create and use dynamic placeholders?
I am learning Sitecore JSS with Next Js as the front end framework. I am working in Sitecore first approach with Sitecore 10.1. I was trying to develop a three column component which will have a placeholder in each of the column and in each of the placeholder there will be some component.
The issue I am facing is the name of the placeholder should be different for each of the placeholder otherwise components will repeat in each placeholder. How can we dynamically generate placeholders in Sitecore jss ?
import { Text, Field, withDatasourceCheck, RichText, Placeholder } from '@sitecore-jss/sitecore-jss-nextjs';
import { ComponentProps } from 'lib/component-props';
type ThreeColumnProps = ComponentProps & {
fields: {
title: Field<string>;
description: Field<string>;
};
};
const ThreeColumn = (props: ThreeColumnProps): JSX.Element => (
<div className="three-column">
<Text field={props.fields.title} />
<RichText field={props.fields.description} />
<div className="column">
<Placeholder name="jss-sample-placeholder" rendering={props.rendering} />
</div>
<div className="column">
<Placeholder name="jss-sample-placeholder1" rendering={props.rendering} />
</div>
<div className="column">
<Placeholder name="jss-sample-placeholder2" rendering={props.rendering} />
</div>
</div>
);
export default withDatasourceCheck()<ThreeColumnProps>(ThreeColumn);
| |
You can change your code a little bit to pass it dynamically. On your cshtml file, from where you are trying to call your API controller, you need to get your datasource item ID and pass this ID as a string parameter to your Get Request.
so your controller be something like this.
[HttpGet]
public JsonResult FeaturedCategories(string datasourceID)
{
}
And then write your code to get the datasource Item.
If you are not able to get the datatabse then write the code something like this.
Sitecore.Data.Database webDB = Sitecore.Configuration.Factory.GetDatabase("web");
webDB.GetItem(new Sitecore.Data.ID(itemID))
| I have an API Controller which returns JsonResult. And I have created a Controller Rendering in Sitecore, how can I pass datasource ID dynamically?
This is my API Controller:
[HttpGet]
public JsonResult FeaturedCategories()
{
Database WebDB = Sitecore.Configuration.Factory.GetDatabase("web");
var dataSourceId = RenderingContext.Current.Rendering.DataSource;
Item dataSourceItem = WebDB.GetItem(new ID(dataSourceId));
if (dataSourceItem == null) return new JsonResult() { Data = string.Empty, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
var model = GetFeaturedCategoriesModel(dataSourceItem);
return new JsonResult() { Data = model, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
private static FeaturedCategoriesModel GetFeaturedCategoriesModel(Item dataSourceItem)
{
FeaturedCategoriesModel model = new FeaturedCategoriesModel();
List<CardDetails> cardDetailsList = new List<CardDetails>();
MultilistField cardLists = dataSourceItem.Fields["Categories"];
model.categoryTitleString = dataSourceItem["CategoryTitle"];
model.categoryDescString = dataSourceItem["CategoryDescription"];
if (cardLists != null && cardLists.Count > 0)
{
foreach (Item cardItems in cardLists.GetItems())
{
string categoriesCardTitle = cardItems["CategoryCardTitle"];
ImageField categoriesCardImageMediaURL = cardItems.Fields["CategoryCardImage"];
string categoriesCardImage = MediaManager.GetMediaUrl(categoriesCardImageMediaURL.MediaItem);
LinkField categoriesAnchor = cardItems.Fields["CategoryPageLink"];
string categoriesAnchorUrl = categoriesAnchor.GetFriendlyUrl();
var CardDetailsObj = new CardDetails()
{
cardTitleString = categoriesCardTitle,
cardImageField = categoriesCardImage,
cardURL = categoriesAnchorUrl,
};
cardDetailsList.Add(CardDetailsObj);
}
}
model.CategoryCardDetails = cardDetailsList;
return model;
}
}
This is the error:
Attempt to retrieve context object of type 'Sitecore.Mvc.Presentation.RenderingContext' from empty stack.
| |
Upgrade Instructions
Download an upgrade package for the required topology and version from the storage. There is a list of available upgrade packages:
Sitecore 10.1.0:
mcc.xp.upgrade.10.1.0-r.0.1.287527.nupkg
mcc.xm.upgrade.10.1.0-r.0.1.287527.nupkg
mcc.xc.upgrade.10.1.0-r.0.1.287527.nupkg
Sitecore 10.1.1:
mcc.xp.upgrade.10.1.1-r.0.1.287525.nupkg
mcc.xm.upgrade.10.1.1-r.0.1.287525.nupkg
Sitecore 10.1.2:
mcc.xp.upgrade.10.1.2-r.0.1.287524.nupkg
mcc.xm.upgrade.10.1.2-r.0.1.287524.nupkg
Sitecore 10.2.0:
mcc.xp.upgrade.10.2.0-r.0.1.287520.nupkg
mcc.xm.upgrade.10.2.0-r.0.1.287520.nupkg
Install the upgrade package to your solution (follow the guideline for Sitecore 10.1 or Sitecore 10.2).
Run the Infrastructure pipeline.
Run the Application pipeline.
Run the check cluster upgrades pipeline. You will see the message to upgrade the AKS in the logs.
Run the cluster version upgrade pipeline (Kubernetes_version 1.24 - select the latest available patch version received from the pipeline in step 5).
Once the above pipelines run successfully, Go to Kubernetes service on Azure Portal and check the AKS version
Note: Upgrade your solution only if the version you have is earlier than the ones listed below in the Solution section. To find out the version of your solution, view the solution.json file in the infrastructure repository of your Sitecore Managed Cloud Containers Azure DevOps project. If your environment is still running on AKS 1.22, it is recommended first to upgrade to AKS 1.23 and then follow the above steps.
| Upgrade Sitecore Managed Cloud Containers from AKS 1.23 to 1.24
AKS will deprecate Kubernetes version 1.23 on April 2nd 2023. Customers whose Sitecore Managed cloud solution based on the older AKS cluster version(1.23 or older) will face issues maintaining their environments. After April 2nd 2023, customers running version 1.23* will not be able to:
Scale their AKS nodes
Manipulation of AKS and VM infrastructure
Is there any detailed documentation pertaining to the steps required to upgrade the package versions and the AKS cluster version?
| |
If you do not want to use this existing field, create your custom field called "Display Text", In your link component your custom class, and in JS when you get that class replace innerHTML of with your display text field value
Otherwise there are longer routes too of extending the item save and update it
| How to set the 'Link Description' value from CMS
I am using a Link component and I want to make the 'Link Description' field a dynamic value. Is there a way to set the 'Link Description' value from the CMS side?
| |
Thank you all for all the suggestions. I finally found the solution though it has some limitations-
I can save base64 images into RTE fields after disabling the HtmlEditor.RemoveScripts setting in the Sitecore.config file:
<setting name="HtmlEditor.RemoveScripts" value="false" />
But, please note that this will allow to save javascript into the RTE field too.
| SItecore 10 Rich Text Editor not saving the xLink:href tag while saving one SVG image
Sitecore 10 Rich Text Editor not saving the xLink:href tag while saving one SVG image from the content editor. Please find the HTML below which I want to save.
I have done all necessary configuration for SVG images.
Anyone can help m to fix this-
<svg id="whatsnew-down-arrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="165" height="165" viewBox="0 0 165 165">
<defs>
<style>
#whatsnew-down-arrow .cls-1, #whatsnew-down-arrow .cls-2 {
fill: #d94029;
}
#whatsnew-down-arrow .cls-1 {
opacity: 0.23;
}
</style>
</defs>
<circle class="cls-1" cx="82.5" cy="82.5" r="82.5"/>
<circle id="Ellipse_1_copy" data-name="Ellipse 1 copy" class="cls-2" cx="82.5" cy="82.499" r="74.781"/>
<image x="31" y="35" width="103" height="95" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGcAAABfCAYAAAD1aNk5AAAHlUlEQVR4nO3de4xdVRXH8c/MlGmhptKxCLVUa7RVCPigPkJAW4JoYlTwge+0RolEUNQUWsQobX1AUYIpFmuiBrSo+EpJjIkPQomaKibVAgmImiZQplRra2NLnbaw/WPd69Rh2nncc+7Zd+Z8k0mT6dy11jm/e87Ze5+11u5KKelQpuHFWIBT0YdeHMRubMfDeAj/qSjGlphSdQDjYDouxTswC8cLUXrQhYQnhUgHsAs/wno8UUG846arw66cN2AZXoKTx/C5nbgPN+LnJcRVCp105bwfVwlhxsrJuKDx70nYUGBcpdEpV87FWIPnF2BrG1bghwXYKpVOEOdl+DbOLNDm/ViCPxVos3C6qw5gBHpxDc4o2O4ZDbtTC7ZbKLmLsxCvEqOwIulq2F1YsN1CyV2ci3BiSbZPxIUl2S6E3MV5BWaUZHtGw3625C7OCxR/S2vS1bCfLbmLM63D7bdE7uI81eH2WyJ3cSY1tTgZU4uTMbU4GVOLkzG1OBlTi5MxtTgZU4uTMbU4GVOLkzG1OBlTi5MxtTgZU4uTMbU4GVOLkzG1OBlTi5MxtTgZU4uTMbU4GVOLkzGjKZ46S5RfnGIwb3kP/i6qxbaUE9qE4CxR7PVszGz87l94XJShHPPcHU2cOXgXXiOKYWeJWsxmycSAqK/chUfxG3wfj43zICYSc/BunIu54tyd4P/P3X5x7rbj17jDMOduuOKpJSL7/jyDao/EHmzCj3H7qA9jZPoxu0B7Q9mB5xRo732ikHiRsZ27u3GnKBIbJKXU/JmZUrompbQzjZ8dKaUrU0p9R9ht5ae/hVhGQ39BcT4rpXRViuMfLztTnP+ZTbtN430ppZUtGB7KdSmlean1g+4EceallK4vMKaVqSGQlNK0lNIlBRpvsi6ltCCl1J0mpjjdjeO7pYS4PpRSmjoFr8by4m67/+MyMUpZhQdF44aJQg9Ow0q8vQT7y/GXbpyDF5bgAN6Km0RF9ETi5fiKKIssg/k4txuLlVc91oPX4macX5KPdnM+1orj6inJRxcWdyu/orhX3DrXiGYPncw7cYM4nuNK9rVwiui2VDbNL8FKUSj7zTb4LJpL8Emc3iZ/fe3ufXO6EOgE3KIzBgk9uFw8pOe003EVjYlOFbeG4/EN0RstV/rEFbNKBcW9U3BI+ffPoUwTz6AZ+Jo81+Tm4CP4dEX+D3XjrxU5Jw58BZ6rvBHjWOkS8axQnTDwt278vsIA4GP4Ip6neoG6MA/Xibiq5HfdYjW5ai4Wc6H5FccxX8xhchjyb+rGXbit4kB6RSfB9WLFogrOafi/QPufwUO5FXd1i4fxV3FvpeHEy6hFYiT3lsbvyh5qN+2/ueF3kep7sN2LdXisucLak1I6P6W0uYQV1vGwJaW0JKW0u2Q/uxt+tpTsZ7RsTqFDT0rpaW9CF4kOfq+v4iszhO3iLWhZ61fElbNDzL2q5pf4Au5p/mLoJPQe8dp0H94kngVV0Y4T1tMmP8fiIH6K1dh65H8crQHrbHEPvgjPKDu6Scw+bBRzqv6h/3m0vLUd4mXZBh3WxbyDeEKc38sMIwzHTir8t+h+vrb4uGrEeV0mzvOwjKav9HSh7g3FxTXpWS7WFPcd649G2/T7meJF01qZt17MnAFcIZII9470x6PNld6L74jdN4a9P9aMSD8+LBIHRxSG8bXLfxs+i5eO9YOTmK1iqPyTsXxovHsZvBFXipTdmmNzN76Mn431g61sNHG2eN/xOtWvR+XIAH4lZv2bx2Og1V1AFuDz4kqa3oqhCcZ+caV8Bn8er5FWi6cexidE+cdAi7YmCgPifHxcC8JQzP45XaIGZZlYhpjsrBHbj+0S+8eNmyI3NzoJH8T1RRnsQK7Gt/CPIowVvfNUn6iIu8nkGiQcFLf3OxSY6lXGtmBTDe6xVmTVWK70G9wDrtDnbhnV1ANitfUKPFCC/Zx4QBznBiUMiMreUO9C8a06u0wnFbFZ3B3uLMtBO3Y7XIxrRXZL1VktRXAIvxUpupvKdNSurSjPFKO480SOdKdyQCzHXC36CJRKuzp43C8y9TficJt8Fs1hEf/l2iAM7W2v8oh4/qxvo88i+bq4Yh5pl8MqdtidIyarq9vtuAWuFQVfba2GqGr74z68VzyHcl4w3S+ulu+qoI6oyr2pe0U7ktWqzx0bju3ipeLtYgWg7eSwcfh7xNL6aVUHcgQP4nP4XpVB5CAOkby4SrS/qpr7xDNmY9WB5CIOMVn9kuhRVkWTvqfwR/H6fVMF/p9GTuIQSSPr8ErtzdM+iD+IOczWEf62beTWRnIrloqCrnZ9a1LD31IZCUN+4sA2kR+3oU3+NjT8bWuTv1GT223tSGbjoyJ1tYx+CU+KFOObReJ+duQsDtES7AP4lMHmr0WwV1Rw3yoayWZJ7uIQ9UFLxEx9bgH2HhXvYW4zQiJ51XSCOE2WisZAraQBbxX5DVVXj4+KThKHqFVdJiarp4zhc4+LyeWN+EUJcZVCp4lDvKy7VJSkzBIlKb1i0NAlhsaHxdzlAP6JH4gl/wMVxDtuOlGcJr14UeNnrujjfJx4jbxHPFseElmplSxctsp/AY08bZuj0etGAAAAAElFTkSuQmCC"/>
</svg>
| |
The "Request Queue Limit" error typically occurs when a large number of requests are being made to the server and the server is unable to process them all simultaneously. The default implementation of the ASP .NET Session State Module uses exclusive locking for each request from the same session. This means ASP .NET will only execute one request at a time from the same browser. Any other request will be locked by the Session State Module and will not be executed until the previous request is complete and it can obtain the exclusive lock.
Sitecore has a good KB article which describes this in more detail which can be found here. Here could be a few possible solutions to your problem:
Sitecore have some settings regarding session management. One is the pollingInterval:
PollingInterval – Specifies the time interval in seconds that the
session-state provider uses to check if any sessions have expired.
The default polling interval is 2 seconds, which can lead to high load on the SQL server, and therefore a high CPU load, leading to longer response times, leading to the request queue not being processed.
Changing the pollingInterval is done 2 places, the SQL Session State Provider itself in the web.config, and the \App_Config\Sitecore\Marketing.Tracking\Sitecore.Analytics.Tracking.config config file
You can change values to 60 seconds like this in the web.config:
<sessionState mode="Custom" cookieless="false" timeout="20" customProvider="mssql">
<providers>
<add name="mssql" type="Sitecore.SessionProvider.Sql.SqlSessionStateProvider, Sitecore.SessionProvider.Sql"
sessionType="private"
connectionStringName="session"
pollingInterval="60"
compression="true" />
</providers>
</sessionState>
And in Sitecore.Analytics.Tracking.config:
<sharedSessionState defaultProvider="mssql">
<providers>
<add name="mssql" type="Sitecore.SessionProvider.Sql.SqlSessionStateProvider,Sitecore.SessionProvider.Sql"
connectionStringName="sharedsession"
pollingInterval="60"
compression="true"
sessionType="shared" />
</providers>
</sharedSessionState>
Configure the throttle concurrent requests per session
In the .NET Framework 4.6.2 and earlier, ASP.NET executes requests with the same Sessionid sequentially and ASP.NET always issues the Sessionid through cookies by default. If a page takes a long time to respond, it will significantly degrade server performance just by pressing F5 on the browser. In the fix, we added a counter to track the queued requests and terminate the requests when they exceed a specified limit. The default value is 50. If the limit is reached, a warning will be logged in the event log, and an HTTP 500 response may be recorded in the IIS log.
To restore the old behaviour, you can add the following setting to your web.config file to opt out of the new behaviour.
<appSettings>
<add key="aspnet:RequestQueueLimitPerSession" value="2147483647"/>
</appSettings>
Switch the Private Session State to In-process mode and configure a Load Balancer to use sticky sessions:
i) In the Web.config file, find the sessionState element.
ii) Change the mode attribute value to InProc.
| The request queue limit of the session is exceeded
In my project media library has more than 200 child item in single folder. I'm trying to upload the image but facing the issue "The request queue limit of the session is exceeded".
Below configuration is already used in Web.config
<add key="aspnet:RequestQueueLimitPerSession" value="25" />
| |
You should build your own custom Windows based SQL Server image, targeting the desired version.
The following steps describe how to do it, targeting MS SQL Server 2019.
Step 1 - Create a dockerfile spec file:
The dockerfile should define the following build steps:
Use a Microsoft servercore image as base image
Define needed environment variables
Copy entrypoint script (same used in Sitecore mssql-developer images images)
Download and install the desired MS SQL Server software as a service
Configure TCP ports and SQL Server login mode
Define Healthcheck command
Define image startup command
Example of dockerfile for MS SQL Server 2019 Windows image:
# escape=`
# This Dockerfile is used to generate images for the following roles: mssql
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ENV sa_password="_" `
attach_dbs="[]" `
ACCEPT_EULA="_" `
sa_password_path="C:\ProgramData\Docker\secrets\sa-password" `
DATA_PATH="C:\data"
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Overwrite base entrypoint with custom one
COPY \tools\entrypoints .
WORKDIR /
RUN Invoke-WebRequest -Uri "https://download.microsoft.com/download/8/4/c/84c6c430-e0f5-476d-bf43-eaaa222a72e0/SQLServer2019-DEV-x64-ENU.exe" -OutFile SQL.exe; `
Invoke-WebRequest -Uri "https://download.microsoft.com/download/8/4/c/84c6c430-e0f5-476d-bf43-eaaa222a72e0/SQLServer2019-DEV-x64-ENU.box" -OutFile SQL.box; `
Invoke-WebRequest -Uri "https://download.microsoft.com/download/f/1/9/f19eaee6-0728-4a0b-9755-9808acc8af0b/EN/x64/DacFramework.msi" -OutFile C:\DacFramework.msi; `
Start-Process -Wait -FilePath .\SQL.exe -ArgumentList /qs, /x:setup; `
.\setup\setup.exe /q /ACTION=Install /INSTANCENAME=MSSQLSERVER /FEATURES=SQLEngine /SQLUSERDBDIR=$env:DATA_PATH /UPDATEENABLED=0 /SQLSVCACCOUNT='NT AUTHORITY\NETWORK SERVICE' /SQLSYSADMINACCOUNTS='BUILTIN\ADMINISTRATORS' /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS /SQLSVCSTARTUPTYPE='Manual'; `
Start-Process -NoNewWindow -Wait msiexec.exe -ArgumentList /i, C:\DacFramework.msi, /quiet, /norestart; `
Remove-Item -Recurse -Force SQL.exe, SQL.box, setup, C:\DacFramework.msi;
RUN set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql15.MSSQLSERVER\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpdynamicports -value ''; `
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql15.MSSQLSERVER\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpport -value 1433; `
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql15.MSSQLSERVER\mssqlserver\' -name LoginMode -value 2;
HEALTHCHECK CMD ["sqlcmd","-Q","SELECT 1"]
CMD .\start -sa_password $env:sa_password -ACCEPT_EULA $env:ACCEPT_EULA -attach_dbs \"$env:attach_dbs\" -DataDirectory $env:DATA_PATH -Verbose
NOTE: Use different download link to target different MS SQL Server software versions. Installation parameters might vary across SQL Server versions as well.
Step 2 - Configure the build command for the mssql service in the docker-compose.override.yml file of your project
Your docker-compose.override.yml file might already have a build command for the mssql service. If it doesn't, add the following section:
mssql:
...
build:
context: ./docker/build/mssql
args:
BASE_IMAGE: mcr.microsoft.com/windows/servercore:${OS_IMAGE_TAG}
The configuration above uses the OS_IMAGE_TAG environment variable to specify the Windows OS targeting version (ie. ltsc-2019).
Step 3 - Copy the Start.ps1 entrypoint script in your host build folder
One of the build steps in the dockerfile described at Step 1 above copies a custom entrypoint start script from the build host machine inside the image. The build step is expecting the start script to be located in the \tools\entrypoints folder relative to the location of the build context (./docker/build/mssql) defined in the docker-compose.override.yml file described at Step 2 above.
The original Start.ps1 script can be copied and exported from one of the Sitecore mssql-developer images, or copied from here below:
# The script sets the sa password and start the SQL Service
# Also it attaches additional database from the disk
# The format for attach_dbs
param(
[Parameter(Mandatory = $false)]
[string]$sa_password,
[Parameter(Mandatory = $false)]
[string]$ACCEPT_EULA,
[Parameter(Mandatory = $false)]
[string]$attach_dbs,
[Parameter(Mandatory)]
[ValidateScript({ Test-Path $_ -PathType Container })]
[string]$DataDirectory
)
if ($ACCEPT_EULA -ne "Y" -And $ACCEPT_EULA -ne "y") {
Write-Verbose "ERROR: You must accept the End User License Agreement before this container can start."
Write-Verbose "Set the environment variable ACCEPT_EULA to 'Y' if you accept the agreement."
exit 1
}
# start the service
Write-Verbose "Starting SQL Server"
start-service MSSQLSERVER
# Enable Contained Database Authentication
Write-Verbose "Enabling contained database authentication"
& sqlcmd -Q "sp_configure 'contained database authentication', 1; RECONFIGURE;"
if ($sa_password -eq "_") {
if (Test-Path $env:sa_password_path) {
$sa_password = Get-Content -Raw $secretPath
}
else {
Write-Verbose "WARN: Using default SA password, secret file not found at: $secretPath"
}
}
if ($sa_password -ne "_") {
Write-Verbose "Changing SA login credentials"
$sqlcmd = "ALTER LOGIN sa with password=" + "'" + $sa_password + "'" + ";ALTER LOGIN sa ENABLE;"
& sqlcmd -Q $sqlcmd
}
#Attach databases in data directory
Get-ChildItem -Path $DataDirectory -Filter "*.mdf" | ForEach-Object {
$databaseName = $_.BaseName.Replace("_Primary", "")
$mdfPath = $_.FullName
$primaryDbEnding = $_.Name.Replace(".mdf", ".ldf")
$logDbEnding = $databaseName + "_log.ldf"
$ldfPath = Get-ChildItem -Path $DataDirectory | Where-Object { $_.Name -eq $primaryDbEnding -or $_.Name -eq $logDbEnding }
$ldfPath = $ldfPath.FullName
$sqlcmd = "IF EXISTS (SELECT 1 FROM SYS.DATABASES WHERE NAME = '$databaseName') BEGIN EXEC sp_detach_db [$databaseName] END;CREATE DATABASE [$databaseName] ON (FILENAME = N'$mdfPath'), (FILENAME = N'$ldfPath') FOR ATTACH;"
Write-Host "INFO: Attaching '$databaseName'..."
& sqlcmd -Q $sqlcmd
}
#attach additional databases from parameter
$attach_dbs_cleaned = $attach_dbs.TrimStart('\\').TrimEnd('\\')
$dbs = $attach_dbs_cleaned | ConvertFrom-Json
if ($null -ne $dbs -And $dbs.Length -gt 0) {
Write-Verbose "Attaching $($dbs.Length) database(s)"
Foreach ($db in $dbs) {
$files = @();
Foreach ($file in $db.dbFiles) {
$files += "(FILENAME = N'$($file)')";
}
$files = $files -join ","
$sqlcmd = "IF EXISTS (SELECT 1 FROM SYS.DATABASES WHERE NAME = '" + $($db.dbName) + "') BEGIN EXEC sp_detach_db [$($db.dbName)] END;CREATE DATABASE [$($db.dbName)] ON $($files) FOR ATTACH;"
Write-Verbose "Invoke-Sqlcmd -Query $($sqlcmd)"
& sqlcmd -Q $sqlcmd
}
}
Write-Verbose "Started SQL Server."
$lastCheck = (Get-Date).AddSeconds(-2)
while ($true) {
Get-EventLog -LogName Application -Source "MSSQL*" -After $lastCheck | Select-Object TimeGenerated, EntryType, Message
$lastCheck = Get-Date
Start-Sleep -Seconds 2
}
Step 4 - Build the custom image
As last step, build the custom MS SQL image executing the docker-compose build mssql command in Windows Powershell in the folder where the docker-compose.override.yml file is located.
| Sitecore Docker Development Image for MS SQL Server 2019
The Sitecore container registry contains mssql-developer images for Windows OS targeting only MS SQL Server 2017 (see full list here).
The Microsoft Artifact Registry contains only MS SQL Server images for Linux OS: https://mcr.microsoft.com/en-us/catalog?search=sql
If I want to use an MS SQL Server image for Windows OS targeting an higher version of SQL Server, for example MS SQL server 2019, what should I do?
| |
Now sure with the particular field but yes, If you want to remove the validation rules from a particular item, then you can do this by using a field on the item called Suppressed Validation Rules
According to the Sitecore document, Validation issues no longer appear in the Quick Action Bar if you suppress global validation rules on individual content items.
Refer to this document:
https://doc.sitecore.com/xp/en/developers/92/sitecore-experience-manager/the-validation-options.html
For example, you can use this one Full Page XHtml, Item ID {9DE34911-96D5-48C3-AFFF-20CFF4D5AB02}. And this is the item ID of the Full Page XHtml validation rule.
Read this thread for more details.
https://stackoverflow.com/questions/8452005/how-do-i-turn-off-xhtml-validation-in-sitecore#:~:text=If%20you%20go%20into%20System,XHTML%20validation%20rule%20from%20there.
| Disable HTML validation on a single RichText field
We have some integration running that's adding html with necessary data attributes to a RichText field, the validator is flashing this as invalid when it is valid in this use case.
How to disable the RichText html validation on a single template field?
The only options I have found are to disable for all RichText fields globally which is not what we want.
| |
Since you have our Sitecore instance running locally, you need to expose your local host URL to the public internet. There are multiple reverse proxy tools to do this like ngrok and localtunnel. I have used ngrok for the local development and it worked pretty well. Below are the steps to configure:
Go to https://ngrok.com. Register and create a free account to get the auth token. Start the tunnel. All the steps are mentioned here. @Sebastian has also written a nice blog to explain the Ngrok set up.
Now you need to create the tunnel for your localhost Sitecore instance. Run the below command:
ngrok http --host-header=rewrite <your-sitecore-domain>:443
You will get a random ngrok.io URL which is pointing to your localhost instance. You can access that URL from anywhere. It means your localhost Sitecore instance now has a public URL.
Update the <app-name>.config in the NextJS application with the new hostname.
Update Sitecore API Host in .env file.
SITECORE_API_HOST= <The URL generated by NGRock>
Update the scjssconfig.json file
Now push the changes to Vercel.
| Vercel cannot access Sitecore CM host as it is not public
I was working on sitecore Headless with Next Js. I have created a sample application with few components and it is working fine in local. Now I tried to deploy this application to vercel.Since the sitecore host is local and is not available in public it is not accessible and deployment fails. Also in our case the QA sitecore host has SSO authentication so I assume in QA also vercel will not be able to access the sitecore host. So wanted to understand if there is any workarounds in such cases.
| |
Yes, you can control the logging level for Sitecore's interaction with Solr by modifying the configuration settings. To do this, you can create a patch configuration file to override the default settings.
Create a new patch file (e.g., DisableSolrQueryLogs.config) in the \App_Config\Include folder of your Sitecore instance.
Add the following content to the patch file:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore>
<log4net role:require="Standalone or ContentManagement">
<logger name="Sitecore.Diagnostics.Search" additivity="false">
<level value="WARN" />
<appender-ref ref="LogFileAppender" />
</logger>
</log4net>
</sitecore>
</configuration>
This configuration patch modifies the logger responsible for Solr query logs (Sitecore.Diagnostics.Search). By setting the logging level to WARN, you will disable INFO level messages, reducing the verbosity of the logs.
role:require="Standalone or ContentManagement" allows to apply this config only on both CM and Standalone servers.
Remember to restart the Sitecore instance or perform an IIS reset to apply the changes.
If you want to keep the INFO level logs on dev/staging environments, you can create a separate patch file with different logging levels for each environment and include the appropriate file in each environment's configuration.
Keep in mind that you may need to adjust the logger name depending on the Sitecore version you're using. For example, in Sitecore 9.3, the logger name might be Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.DefaultSolrStartUp find the exact logger name for your version, check your existing log files or the Sitecore documentation.
| AppData logs contain lots of Solr Query entries - can these be reduced or removed?
I've been trying to diagnose some production websites and noticed that my Sitecore AppData logs are littered with Solr Queries INFO logging messages. Can these be turned off? I looked through all of my configuration files and /sitecore/admin/ShowConfig.aspx to see if there was a configuration setting, but I might be missing them.
I don't mind keeping these on our dev/staging CM servers, but it seems a little inefficient to log all of this on production unless it's on a case by case basis.
Does anyone have any recommendations on how to turn these off, or at least change the verbose level of these logs?
| |
So as it turns out it didn't have anything to do with those two files. It might be the reason it started in the first place, but the problem came from a corrupted device detection database.
We had to delete all files under /App_Data/DeviceDetection/ and restart the Sitecore Instance.
| Can't check device type - device detection is not ready
We are on Sitecore 10.1 and after yesterdays deployment with only minor changes this warning flooded our logs on the CD servers: Can't check device type - device detection is not ready.
We did apply Sitecore's latest security patch KB1002925, where you are advised to delete the Sitecore.MVC.DeviceSimulator.dll and disable Sitecore.MVC.DeviceSimulator.config. But even after reinstating those two files the warning keeps coming. What is wrong?
| |
After investigation and Google, we have found that our web.config contains the following settings:
Based on this information we can confirm that the reported behavior is a registered bug.
To track the future status of this bug report, please use reference number 505522.
To workaround this issue, we consider setting aspnet:AllowConcurrentRequestsPerSession to false.
Please note: that it is also not recommended to enable aspnet:AllowConcurrentRequestsPerSession according to Sitecore doc as it might cause unexpected behavior such as data loss. For more information please refer to this documentation: Walkthrough: Configuring a private session state database using the Redis provider
However, if you wish to keep aspnet:AllowConcurrentRequestsPerSession enable, you could consider an upgrade to XP 10.3 as this bug is fully resolved in that version.
For more details see the blog post: Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync
| Azure PaaS Redis System.NullReferenceException at Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync
We are encountering the following error frequently in our application.
Problem Id:
System.NullReferenceException at Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync+<EvalAsync>d__22.MoveNext
Message: Object reference not set to an instance of an object.
Exception type: System.NullReferenceException
Failed method:
Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync+<EvalAsync>d__22.MoveNext
Call Stack:
System.NullReferenceException:
at System.Object.GetType (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync+<EvalAsync>d__22.MoveNext (Sitecore.SessionProvider.Redis, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at Sitecore.SessionProvider.Redis.RedisSessionStateProviderAsync+<SetAndReleaseItemExclusiveAsync>d__20.MoveNext (Sitecore.SessionProvider.Redis, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at Microsoft.AspNet.SessionState.SessionStateModuleAsync+<ReleaseStateAsyncImpl>d__80.MoveNext (Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at Microsoft.AspNet.SessionState.TaskAsyncHelper.EndTask (Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.HttpApplication+AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Web.HttpApplication.ExecuteStepImpl (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Web.HttpApplication.ExecuteStep (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
The application is deployed on Sitecore Managed Cloud Service Azure PaaS and uses Redis app service.
Sitecore Version: 10.2
StackExchange.Redis DLL version:
I have followed the below links as well:
Sitecore PAAS Redis Exception
Azure Web App Redis timeout exceptions when under load
Any help, please?
| |
To patch you config file you can prepare folder structure as \App_Config\Include\z.Services.GraphQL\z.Sitecore.Services.GraphQL.EdgeContent.config.
As mentioned in read me it is XP0 container topology and thus only has a Standalone cm so you need to place it under ClonedfolderPath\docker\deploy\platform\ directory. platform folder is a cm container.
Try this patch file z.Sitecore.Services.GraphQL.EdgeContent.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore>
<api>
<GraphQL>
<!-- the defaults section contains config templates that can be reused elsewhere using 'ref' -->
<defaults>
<content>
<schemaProviders>
<edgeContent type="Sitecore.Services.GraphQL.EdgeSchema.EdgeSchemaProvider, Sitecore.Services.GraphQL.EdgeSchema">
<templates type="Sitecore.Services.GraphQL.Content.TemplateGeneration.Filters.StandardTemplatePredicate, Sitecore.Services.GraphQL.Content">
<database>$(1)</database>
<!-- Only include our JSS application -->
<paths hint="list:AddIncludedPath">
<foundation>
<patch:delete />
</foundation>
<feature>
<patch:delete />
</feature>
<project>
<patch:delete />
</project>
<userdefined>
<patch:delete />
</userdefined>
<jssSite>/sitecore/templates/Project/OurJssSite</jssSite>
</paths>
</templates>
</edgeContent>
</schemaProviders>
</content>
</defaults>
</GraphQL>
</api>
</sitecore>
</configuration>
then run .\up.ps1
Hope it helps!
| Applying patch config files to a local XM Cloud Docker environment
I'm doing some XM Cloud experiments. Based on the starter kit I've got it running local with Docker: https://github.com/sitecorelabs/xmcloud-foundation-head
There is also a Nextjs project which uses GraphQL. When running jss bootstrap I get this error: 'jss bootstrap' causes JavaScript heap out of memory error on graphql-let step
The fix is a patch config with some changes: https://sitecore.stackexchange.com/a/31669/3309
Does anyone know how I can do this local for XM Cloud? Since it's running in Docker I can't just change any config files or add a patch file. There is a readme file in the starter kit, but a publish doesn't seem to be working: https://github.com/sitecorelabs/xmcloud-foundation-head/blob/main/src/platform/README.md
| |
The SITECORE_API_KEY is the token you need to pass in the header of your request to Experience Edge.
The correct format is:
{
"X-GQL-Token": "XXX_YOUR_TOKEN_HERE_XXX"
}
This is for use only on the Experience Edge delivery end point (https://edge.sitecorecloud.io/api/graphql/v1)
For your preview end point on your CM instance, (https:///sitecore/api/graph/edge) - you need to use the Guid of the API Key item you have created under the path: /sitecore/settings/services/api keys
| Is SITECORE_API_KEY under XM Cloud App Environment variable is treated as X-API-Token for GraphQL?
Team, on XM Cloud i can see the environment variables like below..
Along with GRAPH_QL_ENDPOINT i am assuming, SITECORE_API_KEY is the key which we can pass with X-API-Token to validate. When i tried, it was not working but if it is meant for something else, i would like to know, where we can use it??
| |
Thanks for the comments and suggested answers.
Turns out the problem -- as we suspected -- was in the GTM configuration. The tag being used to load Universal Analytics (UA) inside GTM had been set up with custom parameters that overwrote the page location and stripped all query string parameter from what was reported back to Google, thus removing the related utms from analytics.
| Google Analytics not honoring AdSense campaigns in Sitecore
We are experiencing loss of functionality related to campaign tracking with Google Analytics (GA) using Google Tag Manager (GTM) in our Sitecore instance in all environments.
We can clearly see tags firing and real-time reporting, however campaigns do not pull through. Google AdSense shows user clicks and impressions which link back to the site, each in its correct environment. We have each of Development, Staging, and Production environments, each with their own GTM container, and the issue presents in all 3. Those clicks and impressions are configured to correspond to AdSense campaign parameters, but somewhere they are lost.
The GTM setup and its collection of tags have been reviewed by three independent digital marketing agencies for validity, and they have been found to be without issue by each review. Further, we validated the behavior by putting the same GA tag on a static non-Sitecore site to remove Sitecore from the equation. Both Sitecore and the test site are fronted with Cloudflare using the same configurations (DNS excepted). We could not reproduce the issue on the static site -- all details pulled through as expected.
Are there any known issues with GTM or GA in a Sitecore XP1 k8s deployment environment that I have been unable to turn up from searching the Web? Are there any common catch-outs that we have managed to miss in setting this up?
This is not a new or intermittent issue; it has persisted over the course of the year-plus that we have had this Sitecore instance in production.
Technical details:
Sitecore 10.1-update 2
Deployed to Azure Kubernetes Service (AKS) using XP Scaled topology
Pulling images from scr.sitecore.com/sxp/sitecore-xp1-c[d|m]-10.1.2-ltsc2019
All instances fronted with Cloudflare
| |
I created a support request and got the response, that within JSON variants the JSON Template is only supported from version 10.2 onwards.
https://dev.sitecore.net/Downloads/Sitecore%20Experience%20Accelerator/10x/Sitecore%20Experience%20Accelerator%201020/Release%20Notes
"You can now use Scriban templates in JSON variants. 483214"
Since we are on extended support with 9.3 now, there will not be a fix for this. They created a change request for the documentation to remove the fields now to prevent confusion.
So I was chasing a ghost after all.
Cheers, Simon
| Explanation of the 'JSON Template' within SXAs 'JSON Variants'
I am currently struggeling a bit with understanding the capabilities of the JSON Variants in SXA.
We are on SXA 9.3 and I want to make some customizations to the JSON representation with a JSON variant.
On this page, there is a brief documentation for all the types of fields, you can use within a JSON Variant.
If I did not misunderstand, there should be a way with "JSON Template" to also use Scriban within a JSON Variant, however I am unable to get anything rendered here.
I tried templates with the simplest content, e.g. "test" or only curly brackets "{}" but I do not get any output.
My guess is, that the template has to follow a specific syntax or that it might only work in combination with another type of field, but I don't see that in the doc.
Has someone used Scriban templates in JSON Variants before and could give me a nudge into the right direction?
Hope I described in an understandable way :)
Cheers, Simon
| |
Nothing wrong with the package creation it is due to default configuration, You need to change the setting name AllowDuplicateItemNamesOnSameLevel in Sitecore.config file under App_Config folder. Default it is false to restrict the duplication.
< setting name="AllowDuplicateItemNamesOnSameLevel" value="false"/>
Just changed the setting to true and try the package installation.
You need to use the patch file to update the value as below.
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="AllowDuplicateItemNamesOnSameLevel">
<patch:attribute name="value">true</patch:attribute>
</setting>
</settings>
</sitecore>
</configuration>
Hope it helps!
| Error while installing Sitecore package
I was installing a package and got this error.
The item name "Item1" is already defined on this level.
Is something wrong with my package creation?, How do I fix it?
| |
Your CDP Connection is pointed at the APJ AWS region which isn't valid for your account. The CDP Connector currently doesn't have a "Connection Validation Test" so any values you input into a Connection are considered valid, obviously when you start executing requests with your Recipe if your Connection values are incorrect your Recipe will fail.
I have requested that the CDP Team add such validation to ensure that when you connect a Connection it immediately validates your input.
| 401 Unauthorized response while connecting to Sitecore CDP from Sitecore Connect Recipe
I was able to create connection successfully (using Client Key and API Token) in Sitecore Connect recipe to upload a batch file into Sitecore CDP to create Guest records. But while executing a test, i got below 401 Unauthorized exception like below.
401 Unauthorized: {
"status" : "UNAUTHORIZED",
"code" : 401,
"message" : "Authentication credentials are required to access the resource. All requests must be authenticated.",
"moreInfoUrl" : "https://support.sitecore.com"
} at line: 143
What i am doing wrong here? Any clue?
| |
I'd suggest you keep the managed schema and change the DefaultPopulateHelperFactory class of the PopulateFields processor in the contentSearch.PopulateSolrSchema pipeline instead. Thereby you can keep the managed schema across all your Solr instances and the Populate Schema function will put your Solr schema into the expected state. The default DefaultPopulateHelperFactory is just a simple class implementing IPopulateHelperFactory, so you can roll your own with the changes you need.
If you want to be a bit more ambitious and drive your entire Solr managed schema from the Sitecore config files, you can do so as well. I wrote a post around that a few years ago with sample code: https://mikael.com/2020/10/dealing-with-solr-managed-schema-through-sitecore-config-files/
| The IndexSchema is not mutable - Sitecore Index Rebuild
We are using Sitecore 10.2 with Compatible SOLR 8.8.2. In our case we need to add two custom field in SOLR Indexing. By default SOLR using ManagedIndexSchemaFactory. If we add any new custom field in the Schema file its automatically disappear after Populate Schema file.
After some analysis, I figure out we need to changed the schema factory from ManagedIndexSchemaFactory to ClassicIndexSchemaFactory. So I have followed the below things
Create CORE file
Renaming the "Managed-Schema" to schema.xml
Changed the IndexFactory
Updated the update.autoCreateFields to false
Removed the whole processer "AddSchemaFieldsUpdateProcessorFactory"
https://stackoverflow.com/questions/31719955/solr-error-this-indexschema-is-not-mutable
https://solr.apache.org/guide/8_2/schema-factory-definition-in-solrconfig.html
After done all the changes, restart the SOLR, Sitecore site and Go to control panel, click Indexing Manager and select the index. build started successfully but in the last minute I got the error "The IndexSchema is not mutable"
| |
I suspect nvm version 12.15.0. I tried your command with node version 18.12.1 with my local and it worked for me. I would recommend trying the latest node version and following the steps below.
Install or switch to the latest node version. (nvm install 18.12.1 or nvm use 18.12.1)
Install or use the latest JSS CLI globally (npm install -g @sitecore-jss/sitecore-jss-cli)
Open PowerShell in administrator mode and run command (npx create-sitecore-jss --templates nextjs,nextjs-sxa --appName foodorder --hostName sc103.sc --fetchWith GraphQL)
Configuration details that worked for me:
Hope it helps!
| Error : TypeError: Class extends value undefined is not a constructor or null
To create a Sitecore JSS app, I ran the PowerShell command below :
npx create-sitecore-jss --templates nextjs,nextjs-sxa --appName foodorder --hostName sc103.sc --fetchWith GraphQL
However, I encountered the following error:
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\bn803\AppData\Roaming\nvm\v12.15.0\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110:44)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (C:\Users\bn803\AppData\Roaming\nvm\v12.15.0\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:174:29)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (C:\Users\bn803\AppData\Roaming\nvm\v12.15.0\node_modules\npm\node_modules\make-fetch-happen\lib\remote.js:7:18)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
I ran the command shown below, but it did not work.
npm install socks-proxy-agent@latest
What can I do to resolve this error?
| |
I have performed the below approach to install a Cumulative Hotfix:
Create one separate project in your solution named SitecoreHotfix.Patch or any other name convenient for you.
Add all the cumulative hotfix package files in the same project with the correct file or folder path.
Note: You will need to tweak your CI/CD pipeline in such a way that these Hotfix project artifacts deploy at the end otherwise hotfix files will be overwritten, and you will start facing yellow error pages.
For more details see the blog post: Sitecore Cumulative Hotfixes Installation on OnPrem and PaaS
| Cumulative hotfixes installation on OnPrem and PaaS instances
We have one known issue in Sitecore 10.2 i.e. Retrieving the child items of resource items is not thread-safe
Sitecore provided the cumulative hotfix for it i.e. Cumulative hotfix for Sitecore XP 10.2 and it's available for both XP and XP 10.2 instances.
That such hotfixes are not intended to be installed using the Installation wizard.
Sitecore provided the following articles describing how to install the hotfixes for OnPrem and PaaS instances:
Install a Sitecore XP pre-release using SIF
Deploy a Sitecore XP pre-release to a PaaS solution
Does anyone have installed the same on Sitecore 10.2 on OnPrem and PaaS? Please provide some more detailed instructions on OnPrem and PaaS.
The application has been deployed with Sitecore Managed Cloud Service(Azure PaaS).
| |
You can try adding this to your docker-compose.override.xml file like below.
Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup1: https://${HRZ_HOST}
Here is how it is being added to the file.
id:
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id:${VERSION:-latest}
build:
context: ./docker/build/id
args:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-cd:${SITECORE_VERSION}
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
depends_on:
- solution
environment:
Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup1: https://${HRZ_HOST}
volumes:
- ${LOCAL_DEPLOY_PATH}\identity:C:\deploy
entrypoint: powershell -Command "& C:\tools\entrypoints\worker\Development.ps1"
Then try building and see if it works for you.
| XML Transformation in Sitecore Identity Server using Docker
We have to modify some changes in the Sitecore identity server's Sitecore.IdentityServer.Host file using docker.
This file remains present at the location xp01.localidentityserver.dev.local\Config\production.
We want to modify the domain name with the new domain name, using XML transformation, as you can see in the config below [new-domain-name]
<?xml version="1.0" encoding="utf-8" ?>
<Settings>
<Sitecore>
<IdentityServer>
<CertificateThumbprint>AA69xxxxxxxxxxxxxxxxxxx3A231</CertificateThumbprint>
<CertificateStoreLocation>LocalMachine</CertificateStoreLocation>
<CertificateStoreName>My</CertificateStoreName>
<SitecoreMembershipOptions>
<ConnectionString>Data Source=(local);Initial Catalog=xxxxx_Core;User ID=xxxxxxx;Password=******</ConnectionString>
</SitecoreMembershipOptions>
<AccountOptions>
<PasswordRecoveryUrl>https://[new-domain-name]/sitecore/login?rc=1</PasswordRecoveryUrl>
</AccountOptions>
<Clients>
<DefaultClient>
<AllowedCorsOrigins>
<AllowedCorsOriginsGroup1>https://[new-domain-name]</AllowedCorsOriginsGroup1>
</AllowedCorsOrigins>
</DefaultClient>
<PasswordClient>
<ClientSecrets>
<ClientSecret1>IdentityServerClientSecret</ClientSecret1>
</ClientSecrets>
</PasswordClient>
</Clients>
</IdentityServer>
</Sitecore>
</Settings>
How to perform this activity so that when we deploy this using docker and CI/CD on different environments (dev, uat and prod) then this [new-domain-name] should be according to that.
If with the Sitecore docker, there is any way other than transformation please suggest that as well. We are using Sitecore 10.2 with SXA.
| |
Here is an example taken from the official docs.
Example: The following example gets all of the name/value pairs of a NameValueListField and appends a new pair.
$item = Get-Item -Path "master:" -ID "{371EEE15-B6F3-423A-BB25-0B5CED860EEA}"
$nameValues = [System.Web.HttpUtility]::ParseQueryString($item.UrlMapping)
# Here you can add or remove name/value pairs
$nameValues["^/ab[cde]/$"] = "/somewhere/fun?lang=en"
foreach($key in $nameValues.AllKeys) {
$nameValues[$key] = [Uri]::EscapeDataString($nameValues[$key])
}
$item.UrlMapping = [Sitecore.StringUtil]::NameValuesToString($nameValues,"&")
| Set value for a Sitecore Name Value Field using PowerShell
I have a Name Value List field in Sitecore called "PageSchema". I need to add another name, and value to this PageSchema field using PowerShell.
How can I do it from PowerShell? What I want is something like this.
{
$ArticleItem.Editing.BeginEdit()
try {
NameValueCollection data = new NameValueCollection()
data.Add("name", "value")
ArticleItem["PageSchema"] = StringUtil.NameValuesToString(data, "&")
}
}
| |
If you want to get only values that are selected for the items in your search results, you should pass the second parameter to the .FacetOn() method like this:
.FacetOn(f => f[key], 1)
The second parameter specifies the minimum facet count in the found items to be returned. By default this parameter is 0 and it returns all facet categories stored in the index regardless of your .Where() search query. If you set this parameter to 1, it will only return facets where there is at least one item found for each facet.
| Sitecore facet query on key displaying extra non-selected values
I'm trying to use the Sitecore Solr query to retrieve specific facet values for a Sitecore item. The facet is a checklist filter and the field is a tree list type.
var test = context.GetQueryable<SearchResultItem>().Where(x => x.ItemId == item.ID).FacetOn(f => f[key]).GetFacets().Categories;
However, I end up with extra values which are not selected for that particular item.
Can anyone help here?
| |
It is possible to add a hyperlink to the dialog produced by Read-Variable.
Example: The following example produces a dialog with a hyperlink.
$props = @{
"Parameters" = @(
@{ Name = "info"; Title = "Fancy Link"; Value = "<a href='https://www.google.com' target='_blank'>CLICK ME</a>"; Editor = "info" }
)
"Title" = "Sample Download Wizard"
"Icon" = "OfficeWhite/32x32/server_from_client.png"
"ShowHints" = $true
"OkButtonName" = "Next"
}
Read-Variable @props
| Hyperlink image in PowerShell
Is it possible to have an image in Sitecore PowerShell Extensions GUI that has an embedded hyperlink to open a web page? For instance, if I had an image of a car in a PowerShell GUI form and when a user clicks the image, it would open https://cars.com.
| |
This is doable in Node JS reverse proxy template.
Go to \src\config.ts
Under the ProxyConfig => proxyOptions. Basically, this is http-proxy-middleware, so you can customize it like here.
Add the example of the below line,
/*
* Add custom headers for the layout service here
*/
onProxyReq: function (proxyReq: any) {
proxyReq.setHeader('Authorization', "Value here");
}
| How to add a custom header in every JSS layout service request in Node JS reverse proxy solution template
We are using Sitecore 10.2/Headless/JSS React, also we enabled server-side rendering by hosting behind the Headless JSS proxy.
We require every layout service to authenticate in the backend(Sitecore), and we need to set a custom authorize header for every layout service call. Especially we need this on the server side.
| |
Yes, it is possible. You already have MediaItem object. So I can think of 2 ways to get the filename with an extension.
1. Using MediaUrlBuilderOptions get the full URL and split it to get the filename with the extension.
You need to build the URLs by using the MediaUrlBuilderOptions classes for media items.
Sitecore.Links.UrlBuilders.MediaUrlBuilderOptions mediaUrlBuilderOptions = new MediaUrlBuilderOptions
{
IncludeExtension = true,
};
var fileField = (FileField)item.Fields[fileFieldName];
if (fileField == null) return string.Empty;
var file = fileField.MediaItem;
string urlWithExtention = Sitecore.Resources.Media.MediaManager.GetMediaUrl(file, mediaUrlBuilderOptions);
string fileName = urlWithExtention.Split('/').Last();
2. Using string concatenation.
var fileField = (FileField)item.Fields[fileFieldName];
if (fileField == null) return string.Empty;
Sitecore.Data.Items.MediaItem file = fileField.MediaItem;
string fileName = string.Format("{0}.{1}", file.Name, file.Extension);
Hope it helps!
| Display filename with extension using FileField in Sitecore
I need to display the filename with an extension for a File type field in Sitecore SXA 10.2. The field value in content contains an Url that points to the pdf documents in Media Library.
var fileField = (FileField)item.Fields[fileFieldName];
if (fileField == null) return string.Empty;
var file = fileField.MediaItem;
Is it possible to obtain the filename with an extension using MediaItem with FileField?
| |
Your Sitecore CMS is hosted on Azure, so you have a public URL for Sitecore CMS eg. https://<YourAzureHostName>.azurewebsites.net
Your front end is hosted on Vercel, So you have a public URL eg. https://<YourVercelDomainName>.vercel.app
In the root of the Next.js JSS application directory, Go to /sitecore/config folder and open <app-name>.config file and make sure the below patch is enabled with the correct value.
<sites>
<!--
JSS Site Registration
This configures the site with Sitecore - i.e. host headers, item paths.
If your JSS app lives within an existing Sitecore site, this may not be necessary.
IMPORTANT: JSS sites ship in 'live mode', which makes development and testing easy,
but disables workflow and publishing. Before going to production, change the `database`
below to `web` instead of `master`.-->
<site patch:before="site[@name='website']"
inherits="website"
name="app-name"
hostName="YourAzureHostName.azurewebsites.net"
rootPath="/sitecore/content/app-name"
startItem="/home"
database="master" />
</sites>
On the configuration/sitecore/javaScriptServices/apps path, make sure serverSideRenderingEngineEndpointUrl and serverSideRenderingEngineApplicationUrl are pointed to the correct values.
<apps>
<!--
JSS App Registration
The JSS app needs to be registered in order to support layout service and import services.
There are many available attributes, and they inherit the defaults if not explicitly specified here.
Defaults are defined in `/App_Config/Sitecore/JavaScriptServices/Sitecore.JavaScriptServices.Apps.config`
NOTE: graphQLEndpoint enables _Integrated GraphQL_. If not using integrated GraphQL, it can be removed.
NOTE: layoutServiceConfiguration should be set to "default" when using GraphQL Edge schema.
When using integrated GraphQL with Edge schema, a $language value is injected
since language is required in all Edge queries. "jss" configuration does not do this (which is backwards
compatible with JSS versions < 18.0.0).
-->
<app name="app-name"
layoutServiceConfiguration="default"
sitecorePath="/sitecore/content/<tenant-name>/Home"
useLanguageSpecificLayout="true"
graphQLEndpoint="/sitecore/api/graph/edge"
inherits="defaults"
serverSideRenderingEngine="http"
serverSideRenderingEngineEndpointUrl="https://<YourVercelDomainName>.vercel.app/api/editing/render"
serverSideRenderingEngineApplicationUrl="https://<YourVercelDomainName>.vercel.app"
/>
</apps>
Make sure to update JSS EDITING SECRET in this config.
<!--
JSS EDITING SECRET
To secure the Sitecore editor endpoint exposed by your Next.js app (see `serverSideRenderingEngineEndpointUrl` below),
a secret token is used. This is taken from an env variable by default, but could be patched and set directly by uncommenting.
This (server-side) value must match your client-side value, which is configured by the JSS_EDITING_SECRET env variable (see the Next.js .env file).
We recommend an alphanumeric value of at least 16 characters. />
-->
<setting name="JavaScriptServices.ViewEngine.Http.JssEditingSecret" value="Random_JSS_Editing_Secret_Key" />
Open scjssconfig.json file, and update layoutServiceHost and deployUrl,
{
"sitecore": {
"instancePath": "",
"layoutServiceHost": "https://<YourAzureHostName>.azurewebsites.net",
"deployUrl": "https://<YourAzureHostName>.azurewebsites.net/sitecore/api/jss/import",
"apiKey": "{Sitecore_API_KEY}",
"deploySecret": "Random_Generated_Deploy_Secret"
}
}
Open .env file and make sure you have following variables defined:
PUBLIC_URL=https://<YourVercelDomainName>.vercel.app
JSS_EDITING_SECRET=Random_JSS_Editing_Secret_Key
SITECORE_API_KEY={Sitecore_API_KEY}
SITECORE_API_HOST=https://<YourAzureHostName>.azurewebsites.net
JSS_APP_NAME=app-name
Build (npm run build) and deploy the app to Vercel (vercel --prod)
Make sure app-name.config is deployed to Sitecore root.
Open Sitecore CMS and go to /sitecore/content/<TenantName>/Home/Settings and update Server side rendering engine endpoint URL and ServerSideRenderingEngineApplicationUrl
| Sitecore Headless : How to configure editing host in Azure Paas?
We are planning to have Sitecore Headless solution. The Sitecore CMS will be hosted in Azure Paas (Sitecore Managed Cloud). The frontend application (rendering host) will be hosted in vercel. The frontend application will access items, media and layout information through experience edge.
Now for experience editor we need to set up a editing host so that the experience editor can access the frontend code(Nextjs). I researched some of sitecore documents to get information to set up editing host like this but they all are for XM Cloud.
In local set up Experience Editor works through http://localhost:3000/api/editing/render endpoint.
So how does it work in case of production environment ? I could not find any documents to set up editing host for Azure Pass. Please let me know any information on the setup or point me to any document which describes the set up.
| |
I have been working through this and found the solution. But I wanted to post the write-up here so others can find it in the future.
The main issue on why this errors comes the xConnect scripts in the sitecore-XP0.json file. There are 4 InvokeSqlcmd configured in this json file that look like this.
"Description": "Create Collection Shard Database Server Login.",
"Type": "InvokeSqlcmd",
"Params": {
"ServerInstance": "[parameter('SqlServer')]",
"Credential": "[variable('Sql.Credential')]",
"InputFile": "[variable('Sharding.SqlCmd.Path.CreateShardApplicationDatabaseServerLogin')]",
"Variable": [
"[concat('UserName=',variable('SqlCollection.User'))]",
"[concat('Password=',variable('SqlCollection.Password'))]"
]
},
"Skip": "[parameter('SkipDatabaseInstallation')]"
Normally these work fine. Except now with Windows 11 these call default to using an encrypted connection to SQL. This means it is using a self-signed cert that is not going to be trusted. So is there a way we can make these calls not need the cert? There sure is. We just need to use "TrustServerCertificate": true. So we need to update each of the 4 calls to look like this (this is the update to one of them they all don't need to look like this they all just need to have "TrustServerCertificate": true, added to them.
"Description": "Create Collection Shard Database Server Login.",
"Type": "InvokeSqlcmd",
"Params": {
"ServerInstance": "[parameter('SqlServer')]",
"TrustServerCertificate": true,
"Credential": "[variable('Sql.Credential')]",
"InputFile": "[variable('Sharding.SqlCmd.Path.CreateShardApplicationDatabaseServerLogin')]",
"Variable": [
"[concat('UserName=',variable('SqlCollection.User'))]",
"[concat('Password=',variable('SqlCollection.Password'))]"
]
},
"Skip": "[parameter('SkipDatabaseInstallation')]"
Notice the minor but very important change here of the additional params item. Once you add this your installation will work.
There are a couple more issues you may run into and I will link their solutions here as well to make it easier.
Marketing service will not start
ERR_SSL_KEY_USAGE_INCOMPATIBLE
| Sitecore 9.3 Installing on Windows 11 returns "certificate chain was issued by an authority that is not trusted." error
I know some people's first thoughts will be Sitecore 9.3 is not supported on Windows 11 per their documentation. And that is fair but it can be done and can still work.
However, there are a few challenges. The installation does not work out of the box because Windows 11 have started to enforce a security change Microsoft has rolled out. This change makes connections to the SQL server default to use encrypted connections. This means some of the Powershell scripts in the install error with this error.
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
It errors because the cert is self-signed and is not fully trusted. So is there a way to address this so the installs run?
| |
Under your Master database you can find the items into [dbo].[ArchivedItems] table.
The table looks like this.
So if you delete an item. It will create an entry into this.
Here is the Database query for this.
SELECT TOP (1000) [RowId]
,[ArchivalId]
,[ItemId]
,[Name]
,[TemplateID]
,[MasterID]
,[ParentID]
,[Created]
,[Updated]
FROM [sitecore10.2_Master].[dbo].[ArchivedItems]
If you want to see, who deleted this item, then you can check the table called [dbo].[Archive].
SELECT TOP (1000) [ArchivalId]
,[ItemId]
,[ParentId]
,[Name]
,[OriginalLocation]
,[ArchiveDate]
,[ArchivedBy]
,[ArchiveName]
FROM [sitecore10.2_Master].[dbo].[Archive]
Take the ArchivalId from ArchivedItems table and search in the Archive table using the same. And you will get the details.
Hope this helps.
| Which table does store the Sitecore Recycle Bin items?
I would like to see the items moved to recycle bin.
In which database table, can we see the items details?
| |
Apparently the version what not the issue - but the parameters. Including nextjs-sxa appears to be only supported for XMCloud. Found that in some well hidden docs - although I must admit that if you don't use it you are asked to include it and it is very clearly mentioned in that case.
Lesson learned: use lesser parameters in the creation command and let the questions come to you..
| Which JSS version for Sitecore 10.2?
I am trying to setup a JSS app on Sitecore 10.2 (with SXA) but that is not going as expected.
I checked the downloads page for Headless Rendering and that mentions version 20.0.2 as latest now compatible with Sitecore 10.2. This install went fine. Creating a headless site with SXA seems to have worked and our graphQL playground is working.
I assumed that for the actual front-end app I had to use the same version (https://sitecore.stackexchange.com/a/30563/237 confirms that) so I used "npx create-sitecore-jss@ver20 --templates nextjs,nextjs-sxa ..." to do a setup and that created a nextjs app for me. Did the rest of the setup and config deploys and that seemed to go well - but when I start the site I get an error: Cannot query field "site" on type "Query".
Apparently the RedirectsQuery is doing a graphQL query for "sites" which is not supported. If I try that in my graphQL-UI it is indeed not in the schema. It is as from 10.3 however.
So now I'm thinking I have some wrong version somewhere.. so the question is actually if anyone has an idea what version I should be using on a Sitecore 10.2?
| |
I would recommend you change the logging level of the search log. That is all you need to reduce the size of the log file as per your logs details the search log file is mostly filled with Info logs so change it to WARN.
The search log contains information about the search queries that Sitecore executes. It is not specific to sitecore_testing_index index. By default, it sets an Info logging level for the Search log. Therefore you have a lot of info search log details logged into the file.
<logger name="Sitecore.Diagnostics.Search" additivity="false">
<level value="INFO" />
<appender-ref ref="SearchLogFileAppender" />
</logger>
Try to change the logging level to WARN using the below patch:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<log4net>
<logger name="Sitecore.Diagnostics.Search" additivity="false">
<level>
<patch:attribute name="value">WARN</patch:attribute>
</level>
</logger>
</log4net>
</sitecore>
</configuration>
log4net offers the following log levels, in increasing order of priority: ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF.
You can update logging levels as per the above priority order to match your requirement. Also if you need to off the search log then you can use the logging level OFF.
Hope it helps!
| Reducing search log size in Sitecore 10.1 for sitecore_testing_index?
How can I reduce the size of my search logs in Sitecore 10.1? Just one search log is currently reaching over 2 GB in size within a few hours, and I've observed that the majority of them are associated with the sitecore_testing_index index. Is there a way to prevent this particular index from generating such large logs?
3608 11:16:20 INFO Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
29292 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
24700 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
24700 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
29292 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
22552 11:16:20 INFO Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
22552 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
13688 11:16:20 INFO Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
22552 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396bzhcn") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396bzhcn") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
20868 11:16:20 INFO Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
13688 11:16:20 INFO Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
13688 11:16:20 INFO Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
29292 11:16:20 INFO Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
24700 11:16:20 INFO Solr Query - ?q=host_s:("9294241878304ad78dd0afffc5f8247aen") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
| |
This issue is happening when your NextJS doesn't contain a component code with the default variant.
To fix this issue, create a NextJS component code with a default variant at least. Then you can see at least the below component missing panel on your page, instead of an error.
| Headless/SXA/Next.JS : Server error : TypeError: Cannot read properties of undefined (reading 'CustomVariant')
We are using Sitecore-10.3/Headless/SXA/NextJS. When we build a custom new component with few custom variants, we receive errors. We will not receive this when we use the "Default variant".
Steps to reproduce
Create a new headless component(rendering)
Add a rendering variant example "CustomVariant", other than the "Default" variant
Go to experience editor and assemble this component on the page.
Change the variant to "CustomVariant"
Save the page, Immediately you will receive an error in the experience editor as like below,
Connection to your rendering host failed with an Internal Server Error error. Ensure the POST endpoint at URL http://localhost:3000/api/editing/render has been enabled.
6. Go to the NextJS application and check the same page.
Error:
Server error
TypeError: Cannot read properties of undefined (reading 'CustomVariant')
Source
src\temp\componentFactory.ts (90:21) @ exportName
88 |
89 | if (exportName && exportName !== DEFAULT_EXPORT_NAME) {
90 | return component[exportName];
| ^
91 | }
92 |
93 | return component?.Default || component?.default || component;
NA
This issue is not happening when you assign the "Default" variant to the component.
| |
This issue is happening because of your custom module site setup root is using a template from "Experience Accelerator", instead of "JSS Experience Accelerator". Follow the steps to fix this
Go to your modules, where you created them. In my case /sitecore/system/Settings/Feature/YourSite/CustomModule/Headless CustomModule Site Setup.
Check the template used. It pointing the legendary "Experience Accelerator".
This should be corrected. Configure => Change your template like below,
Now try to install module to your headless-SXA website. It will show your custom module.
Note: This issue is applicable for Tenant setup as well. You should change this template in your module /sitecore/system/Settings/Feature/OMNIA/Headless Experience Accelerator/HeroBanner/HeroBanner Tenant Setup
| Headless/SXA/NextJS - Add site module is not showing up my newly created headless module
We are using Sitecore-10.3/Headless/SXA/NextJS.
Trying to add a new custom SXA headless module to my headless-SXA website but the newly created module is not showing up.
Steps to reproduce
Create a new module using the "Add module" option in /sitecore/system/Settings/Feature.
Post this include some renderings by the options add/clone rendering as per your wish.
Now try to add this new custom module to your headless-SXA site. Using the script "Add site module".
Expectation is to show the newly created custom headless module but this is not showing the new custom headless module.
| |
Try out the below script, Just replace master with your database name.
if(($db = Get-Database -Name "master" -ErrorAction SilentlyContinue)) {
$db
} else {
Write-Host "Does not exist."
}
Hope it helps!
| How to check custom database exist or not in Powershell script
We have created a custom database Preview in Sitecore Sxa. We need to check this database is exist or not through Sitecore Powershell script.
Could someone let me know how we can check database exist or not in Sitecore powershell script?
| |
The language field in the Search Query Builder is mapped to the index field parsedlanguage. It means that this field is looking at the full language names, for example "english", "english_united_states", german_germany" instead of culture codes like "en", "en-US", "de-DE".
So if you want to search by the context language code, consider using the culture field in your search query like this:
custom:culture|en
You can also try using the language field, but be careful if you have more than one culture for the same language on the website because the following query will return results for all matching languages ("English", "English (United States)", etc.):
language:english
| How to get results based on current context language using rendering variant Search Build Query?
I am using rendering variant query item to write the search build query to get the related items.
I want to query items that should also match current user context language.
I have tried using language: en explicitly in the query to check but still I get items in the result other than English:
Please find the attached query:
+template:{342696b0-2b67-406f-c7acc7894741};+sxa:TaggedWithAtLeastOneTagFromCurrentPage|SxaTags;+language:en;+sort:__smallupdateddate_tdt[desc]
| |
Here is a blog that you can refer to know more about JSS – Conclusions after couple of months in large-scale project and you will find some analysis and here is the one that you are looking for.
Sitecore Forms works in JSS but the implementation is React only for:
out-of the box and custom form fields support,
field value providers,
standard and custom submit actions.
There are missing features though (forms conditions), hopefully will be addressed by Sitecore in the future.
This functionality comes out of the box with Sitecore. It isn’t, however, an out of the box feature of the React JSS application. Instead, it requires manual setup.
So as @Andrey mentioned, you need can find how they have setup it manually using this blog.
Sitecore Forms and JSS: Conditional logic in React
| Sitecore forms - Conditional logic not working with JSS app
Sitecore Forms field conditions are not working with JSS form package in Sitecore Version 10.2.
Does it require custom implementation?
My Code:
import { Form } from '@sitecore-jss/sitecore-jss-react-forms';
import React from 'react';
import { NextRouter, withRouter } from 'next/router';
import { sitecoreApiKey, sitecoreApiHost } from 'temp/config';
const SitecoreForms = ({ fields, router }: { fields: any; router: NextRouter }) => {
return (
<Form
language={router.locale}
form={fields}
sitecoreApiHost={sitecoreApiHost}
sitecoreApiKey={sitecoreApiKey}
onRedirect={(url) => router.push(url)}
/>
);
};
export default withRouter(SitecoreForms);
As per my condition button should visible only when checkbox is checked
but the button is visible in the form even when the checkbox is unchecked:
Any help is highly appreciated.
| |
I do follow this way and it works great for me.
If you want to move the entire site/tenant from 1 environment to another you need to create a Sitecore package.
Refer following steps to create a site package.
Rightclick site/tenant and select -> Srcipt -> Packaging -> start new packaging.
Select Add tree to package and click Add.
Installation option window select the item, that you want to move to another environment along with content and click ok.
Right click again the site and select -> Srcipt -> Packaging -> Download Package.
Download package window will appear and then put the necessary details and click ok.
Once it is completed it will show a download window click on the download button.
Now you can install this package into another environment in the same way using installation wizards.
You can validate the new site in the SXA site manager and change the order to be in an Ok state.
Updated Answer:
Follow these steps to add specific items to the package.
Right-click the item you want to create a package and -> Srcipt -> Packaging -> start new packaging -> Add Item to Package. like here Page 1 click ok.
Repeat the 1st steps to add any other items like your case -> /Settings/Site Grouping and instead of start new packaging select Add Item to Package. So now your package has specific items Page1 and Site Grouping only.
Now you -> Srcipt -> Packaging -> Download Package.
That way you can add required items only without adding a lot of unnecessary items.
Hope it helps!
| How to copy a Sitecore 10 site from one environment to another?
How can I copy a Sitecore 10 site from one environment to another?
I've created a site package and installed it in the new environment, but the site isn't appearing in the SXA site manager.
Is there more effective way to install a site from one environment to another?
Here are the steps, I am following to copy site from environment A to environment B.
1- In environment A, create a new package that includes the Site tenant and all its descendants.
2- Install this package into environment B.
3- Include the Site grouping in the Sites item located at /sitecore/system/Settings/Foundation/Experience Accelerator/Multisite/Management/Sites.
4. Check the site in the SXA site manager and its shows `ok` state.
5. Accessing the site URL gives the 404 error.
I have not published the installed package into the web database.
| |
High disk space consumption in xDB indexes may occur due to a large amount of data being collected and stored. To manage this, you can take several steps to optimize and reduce the size of your xDB indexes without losing valuable data. Here are some suggestions:
Index only required fields: Review the fields being indexed and ensure that you're only indexing the data that's necessary for your reporting and personalization needs. You can update the configuration files to exclude unnecessary fields from indexing.
Configure data retention policies: Set up data retention policies in xConnect to automatically remove data that's no longer needed. You can define the retention period based on your requirements, and the data will be deleted after the specified period. You can find more information here https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-platform/tracking-changes-to-the-xdb-index.html
https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-platform/configuring-the-xconnect-search-indexer.html#sc-xdb-collection-data-sql-xml_body
Think about tracking anonymus users interaction if you really need to track this information. Because it takes ton of space. https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-platform/enable-indexing-of-anonymous-contacts-in-the-xdb-index.html
Monitor index growth: Keep an eye on the index size and growth rate to understand the trends and make adjustments as needed. This will help you proactively manage storage space and ensure that you're not consuming more space than necessary.
Partition the indexes: If your xDB indexes are growing too large, consider partitioning them based on date or other criteria. This will help you manage the indexes more effectively and reduce the overall disk space consumption.
As for deleting indexed data, doing so will result in the loss of historical data and can impact reporting, personalization, and other features that rely on this data. Be cautious and make sure to understand the implications before deleting any indexed data. It is recommended to create backups before performing any data deletion operations.
If you decide to delete the indexed data, you should also rebuild the indexes to ensure that the search index accurately reflects the data in xDB. Note that rebuilding the indexes can be a time-consuming process, especially for large datasets.
| XDB Indexes Consumes More Disk Space
I am using Sitecore 9.3 and xConnect.
The issue is xDB indexes are consuming disk space more than 100GB.
This disk space consumption is increasing day by day. We are using XDB for interactions and showing the aggregated data in power BI. We are not using sitecore analytics dashboard. I plan to delete the xDB indexes.
Is there any impact if i delete the xDb index data?
| |
Understanding XDT can be a bit difficult at first. To explain how the transformation works, let's go through the XML, step-by-step.
XDT looks for configuration element in the XML to modify.
It then looks for a system.webServer element.
It then looks for an httpProtocol element.
It then finds customHeaders element.
It then looks for an add element (you probably have multiple of these).
It then finds add element's which key attribute equals Content-Security-Policy.
Finally, it updates the value of Content-Security-Policy with provided value.
If you look into the current web.config file, you will notice 2 XML nodes.
For CD do apply outside of the node <location path=sitecore> and it will work fine. You can go with the first xdt example file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="SAMEORIGIN" xdt:Transform="Insert"/>
<add name="Content-Security-Policy"
value="default-src 'self' 'unsafe-inline' 'unsafe-eval' https://apps.sitecore.net; img-src 'self' data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' 'unsafe-inline' https://fonts.gstatic.com; upgrade-insecure-requests; block-all-mixed-content;
frame-ancestors 'self';" xdt:Transform="Replace" xdt:Locator="Match(name)"/>
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Hope it helps!
| How do I configure Response Headers that apply to the content delivery system not Sitecore?
We are in the process of launching a new site hosted in Azure. We have been running Tenable Scans on the site.
The report keeps indicating that the response header is missing X-Content-Type-Options and some Content-Security-Policy settings in the Web.config.
Seems like an easy thing to fix, except it appears those settings are already in place; however, I missed the fact that they are under the node of <location path=sitecore>as shown below.
My colleague said we need to set these polices outside of the node <location path=sitecore>, but I am not exactly certain where these need to go, and we don't want to remove the node <location path=sitecore>.
I had the same problem with X-Frame Options and I set up this xdt:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="SAMEORIGIN" xdt:Transform="Insert"/>
<add name="Content-Security-Policy"
value="default-src 'self' 'unsafe-inline' 'unsafe-eval' https://apps.sitecore.net; img-src 'self' data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' 'unsafe-inline' https://fonts.gstatic.com; upgrade-insecure-requests; block-all-mixed-content;
frame-ancestors 'self';" xdt:Transform="Replace" xdt:Locator="Match(name)"/>
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Note: I did not include the <location path=sitecore> in the above and the problem was resolved, so do I just set up a similar xdt?
<location path="sitecore">
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="X-Content-Type-Options" />
<remove name="X-XSS-Protection" />
<remove name="Content-Security-Policy" />
<add name="X-XSS-Protection" value="1; mode=block" />
<add name="X-Content-Type-Options" value="nosniff " />
<add name="Content-Security-Policy" value="default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' 'unsafe-inline' https://fonts.gstatic.com; upgrade-insecure-requests; block-all-mixed-content;" />
</customHeaders>
</httpProtocol>
</system.webServer>
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>
| |
For your second question, i.e. "should it be installed on the CM server only or on any other servers I will need in my scaled setup?"
The answer is it depends on how you install your scaled setup. If you are installing all the roles on a single server and then distributing the things on others then you only need to install it on your CM instance.
But if you are installing things specific to each server role then you need to install it on each server. The thing is this is a prerequisite tool and you can get an error while installing Sitecore package on different servers.
For your first question, yes you need to install it manually by using this link.
https://www.microsoft.com/en-us/download/details.aspx?id=56833
So once you click on the "Download" button, you will be prompted to select the files you need. And you need to select the following two.
ENU\x64\SQLSysClrTypes.msi
ENU\x64\SharedManagementObjects.msi
Hope this helps.
| ERROR_SMO_NEEDED_FOR_SQL_PROVIDER when installing Sitecore 10.2 on scaled setup
I'm using SIF to install Sitecore 10.2 on a scaled environment, I'm facing the issue while trying to install the CM role on the CM server, and part of the installation is to deploy the databases on a separate dedicated db server.
I've filled in the sitecore-Xp1-cm.json file and tried running it with SIF multiple times, the first part goes through then the below error shows up:
> [WebDeploy]:[Path] C:\Program Files\iis\Microsoft Web Deploy
> V3\msdeploy.exe Info: Adding sitemanifest (sitemanifest). Error count:
> 1. Error Code: ERROR_SMO_NEEDED_FOR_SQL_PROVIDER More Information: The SQL provider cannot run because of a missing dependency. Please make
> sure that Microsoft SQL Server Management Objects (Version 10 or
> higher) is installed. Learn more at:
> http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SMO_NEEDED_FOR_SQL_PROVIDER.
> Install-SitecoreConfiguration : Command C:\Program Files\iis\Microsoft
> Web Deploy V3\msdeploy.exe returned a non-zero exit code - (-1) At
> line:1 char:1
> + Install-SitecoreConfiguration -Path sitecore-XP1-cm.json
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
> + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration
Things I have tried so far:
ran the prerequistes.json file, which turned out to be unreliable since Web Platform Installer has been retired in December 2022 (reference answer here)
manually reran all the installations of the prerequisites as per the official sitecore documentation, and following the recommendations of this sitecore support blog->
IIS
ASP.NET 4.8
Web administration PowerShell Module
SQL PowerShell Module
Web Deploy 3.6 (chose "Typical" setting on installation at first, uninstalled and reinstalled as "Complete"
DacFx x86 here
DacFX x64 (same link above)
Microsoft System CLR Types for SQL Server 2017.
Installed Microsoft ODBC Driver 13 for SQL Server
Installed Microsoft Command Line Utilities 13 for SQL Server
Ran "Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServer -All"
Everything is being run as administrator, I have SQL Server 2019 on my DB Server.
Every thread I follow online says I need to Install the latest version of SMO using Web Platform Installer, but it's been retired last year and I cannot find it anywhere,
So my question is: How can I install SMO without the retired Web Platform Installer?,and should it be installed on the CM server only or on any other servers I will need in my scaled setup? (e.g. CD, processing, even the DB server itself, etc.)?
| |
I don't see any issue with your patch file but Your custom processor is missing the Process(RenderFieldArgs args) method. You need to update your code a bit. I tested this code with my local and put the breakpoint to validate. it hits the processor code.
public class CustomGetImageFieldValue
{
public void Process(RenderFieldArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (args.GetField().Value.Contains("{CompanyName}"))
{
//Put your custom logic
RenderFieldResult result = new RenderFieldResult();
SetRenderFieldResult(result, args);
}
}
protected virtual void SetRenderFieldResult(RenderFieldResult result, RenderFieldArgs args)
{
args.Result.FirstPart = result.FirstPart.Replace("{CompanyName}", Sitecore.Globalization.Translate.Text("CompanyName"));
args.Result.LastPart = result.LastPart.Replace("{CompanyName}", Sitecore.Globalization.Translate.Text("CompanyName"));
args.WebEditParameters.AddRange((SafeDictionary<string, string>)args.Parameters);
args.DisableWebEditContentEditing = true;
args.DisableWebEditFieldWrapping = true;
args.WebEditClick = "return Sitecore.WebEdit.editControl($JavascriptParameters, 'webedit:chooseimage')";
}
}
Patch file:
<configuration xmlns:patch="https://www.sitecore.com/xmlconfig/">
<sitecore>
<pipelines>
<renderField>
<processor patch:after="*[@type='Sitecore.Pipelines.RenderField.GetImageFieldValue, Sitecore.Kernel']" type="RPM.MarketingSite.Feature.Components.Pipelines.CustomGetImageFieldValue, RPM.MarketingSite.Feature.Components" />
</renderField>
</pipelines>
</sitecore>
</configuration>
Hope it helps!
| GetImageFieldValue in RenderField pipeline not able to hit
While extending Sitecore.Pipelines.RenderField.GetImageFieldValue not getting hit in my code.
Even my component contains media field in it, any specific reason ?
OR is there any other way to replace run time alt text value in media while using glass mapper to render media field ?
Html.Glass().RenderImage
below is my code & patch configuration.
Code :
public class CustomGetImageFieldValue : GetImageFieldValue
{
protected override void SetRenderFieldResult(RenderFieldResult result, RenderFieldArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (args.GetField().Value.Contains("{CompanyName}"))
{
args.Result.FirstPart =
result.FirstPart.Replace("{CompanyName}", Sitecore.Globalization.Translate.Text("CompanyName"));
args.Result.LastPart =
result.LastPart.Replace("{CompanyName}", Sitecore.Globalization.Translate.Text("CompanyName"));
args.WebEditParameters.AddRange((SafeDictionary<string, string>) args.Parameters);
args.DisableWebEditContentEditing = true;
args.DisableWebEditFieldWrapping = true;
args.WebEditClick = "return Sitecore.WebEdit.editControl($JavascriptParameters, 'webedit:chooseimage')";
}
}
}
patch :
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:env="http://www.sitecore.net/xmlconfig/env/">
<sitecore>
<pipelines>
<renderField>
<processor patch:after="*[@type='Sitecore.Pipelines.RenderField.GetImageFieldValue, Sitecore.Kernel']" type="RPM.MarketingSite.Feature.Components.Pipelines.CustomGetImageFieldValue, RPM.MarketingSite.Feature.Components" />
</renderField>
</pipelines>
</sitecore>
</configuration>
| |
It looks like related to configuration only. You can try changing your configuration a bit like use AnalyzingInfixLookupFactory in lookupImpl and also removes dictionaryImpl.
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">mySuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="field">autocomplete__txtsug</str>
<str name="suggestAnalyzerFieldType">string</str>
<str name="buildOnStartup">true</str>
</lst>
</searchComponent>
Also, Add the new field in Managed-Schema file.
<fieldType class="solr.TextField" name="textSuggest" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
Refer to this for step-by-step details: Enabling the Suggester from SOLR for the Search box
Updated
Use copyfields to combine multiple fields into a single field and use that field as a suggester.
schema:
<copyField source="name" dest="mynewfield" />
<copyField source="other_name" dest="mynewfield" />
suggester:
<str name="field">mynewfield</str>
Hope it helps!
| Solr auto suggest from multiple fields
I am trying to Solr auto suggest query from multiple fields (say for example, name_t, description_t) in a single request handler or same suggest.dictionary.
I have the configs as below, when I have multiple "field" under the same suggester, it's not working. Also, when I try with the same name that's also not working.
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">NameSuggester</str>
<str name="lookupImpl">FSTLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">name_t</str>
<str name="suggestAnalyzerFieldType">string</str>
</lst>
<lst name="suggester">
<str name="name">DescriptionSuggester</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="lookupImpl">FSTLookupFactory</str>
<str name="field">description_t</str>
<str name="suggestAnalyzerFieldType">string</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
<str name="suggest.dictionary">DescriptionSuggester</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
C# Code
using (var ctx = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext())
{
SolrSuggestQuery q = "Description";
var options = new SuggestHandlerQueryOptions
{
Parameters = new SuggestParameters
{
Count = 10,
Build = true
}
};
var result = ctx.Suggest(q, options);
var resultnew = result.Suggestions["DescriptionSuggester"].Suggestions.Select(a => a.Term);
}
| |
After investigating it on my local instance I found that this is not possible OOTB. However, when I tried to customize it I found where the functionality is given. Here is what I found.
When I searched for the textbox taking the input on the rule editor window, I found that it is coming from a file called Prompt.xml and the functionality is being handled using a JS file called prompt.js that exists on the below path.
\wwwroot\<your-site-root>\sitecore\shell\Applications\Dialogs\Prompt
I added a new function in the prompt.js file to validate the regex pattern.
Here is the code.
function isValidRegex(s) {
try {
const m = s.match(/^([/~@;%#'])(.*?)\1([gimsuy]*)$/);
return m ? !!new RegExp(m[2],m[3]) : false;
}
catch (e) {
return false
}
}
In this file I called this function in the ok_click event like below.
function ok_click(evt)
{
var inputValue = $("Value").value;
if(!isValidRegex(inputValue))
{
alert("not a valid regex");
return;
}
....
....
....
}
So now if you click on the OK button it will validate and show you a message that the regex is not valid.
But I analyzed that this is not the place where it should be customized. Because it will work for all types of rules as I didn't find a way to identify it with a particular rule to validate the regex.
After investigating it more, I observed that it should be validated after all the rules are set by the user. When the user clicks on the OK button on the Create Rule window it is handled by this function that exists in the Sitecore.Client DLL under class Sitecore.Shell.Applications.Rules.RulesEditor.RulesEditorPage. Here is the source code.
protected override void OK_Click()
{
string rulesXml = this.Rules;
if (string.IsNullOrEmpty(rulesXml))
rulesXml = "-";
else if (new RulesDefinition(rulesXml).GetValidationErrors().Count > 0)
SheerResponse.Alert("This rule may not function correctly if you do not enter values for all the parameters in all the conditions and actions.");
SheerResponse.SetDialogValue(rulesXml);
base.OK_Click();
}
Finally, on the GetValidationErrors() function you will get all the rules added by the user and it should be customized here.
Now the answer to the question is you need to extend this more to handle your situation and then use this with your solution.
Hope this help you to understand what you are looking for.
| Sitecore Rule Editor Regex syntax validation
Is there any way to validate regex pattern input on the rule editor when the string operator condition is selected as match regular expressions? We would like to avoid typos on regex input.
| |
The issue is that you are reading the values from your CSV and directly binding into the TreeList field but the items you are binding don't exist in Sitecore.
If you will see the raw value of the TreeList Field it's a combination of Sitecore Item IDs with a pipe(|) separator. So in your case, those items do not exist in the Sitecore database and that's why they are showing like this.
So the code will be something like this.
$services = $row."Services".Split(",");
if($itemsGuidFromYourTreeListField -ne $null)
{
foreach($service in $services)
{
# Get item by it's Path
$currentItem = Get-Item -Path $service.ItemPath
if($currentItem){
{
# Write logic to append the ID of $currentItem in pipe separated ID's
}
}
}
$item = Get-Item -Path "master:" -ID "<Your Item ID>"
$item.Editing.BeginEdit();
$item.Fields["YourTreeListField"].Value = "<pipe separated ID field>";
$item.EndEdit();
And if you have the ID's of items that exist in your Sitecore database from your CSV then you don't need to use the method Get-Item to find those. In this case, you can loop through to create a string like this.
{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}|{652F3B26-3474-4C79-8A86-AC70CBC26F91}|{D119BAAE-A1D3-46B0-AE2D-748D50B3C94D}
And directly use begin and end edit to update your field.
Hope this helps.
| What is the correct syntax to update the value of a Tree-list field type on an item in Sitecore using Powershell?
I have a Treelist field type on an item which I am trying to update using a Powershell script which is reading data from a CSV file. I am using the following snippet in my script:
#Create an array of values from CSV (comma separated list)
$services = $row."Services".Split(",")
foreach($service in $services) {
$item["Service"] += $service
$item["Service"] += "|"
}
But I get the following result:
Does anyone know the correct way to update this type of field?
| |
Try login without the identity server by following this approach.
To prevent Sitecore from redirecting users away from the sitecore/login page.
Patch the shell login page back to /sitecore/login, or request
/sitecore/login with extra an URL parameter (?fbc=1).
Alternatively, patch the legacyShellLoginPage property of the
InterceptLegacyShellLoginPage processor to some random value.
Either of these actions prevents Sitecore from redirecting users away from the /sitecore/login page. The SI server is configured as a regular external identity provider in Sitecore and it means you see its sign-in button on the /sitecore/login page. The caption is Go to login.
Refer to the Sitecore article for Disabling Sitecore Identity.
If this works, you can modify the item that is creating the issue and then revert it back.
Hope this works.
| The path must start with a '/' followed by one or more characters
Using Sitecore 10.1.2
In my local machine, I have installed the instance and deployed the code and Sitecore items.
The solution uses TDS.
This is a multi-site project and one of the Site Grouping items is like this:
----field----
field: {475031D8-724D-463C-80B2-90839DD1AD98}
name: VirtualFolder
key: virtualfolder
content-length: 1
Meaning, there is no field value, but still the content-length is 1.
Could this be a reason. But isn't this a content item. Will the CMS still not load because of this? Even the login page isn't loading.
Anyways, I added / as the field value in the code for that item and then tried to do TDS Sync with Sitecore. But it throws an error saying:
That's because the CMS isn't loading.
Wen I browse my CMS, it throws this error:
The path must start with a '/' followed by one or more characters.
Parameter name: value
Description: An unhandled exception occurred
during the execution of the current web request. Please review the
stack trace for more information about the error and where it
originated in the code.
Exception Details: System.ArgumentException: The path must start with
a '/' followed by one or more characters. Parameter name: value
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: The path must start with a '/' followed by one or
more characters. Parameter name: value]
Microsoft.Owin.PathString..ctor(String value) +119
Owin.MapExtensions.Map(IAppBuilder app, String pathMatch, Action`1
configuration) +108
Sitecore.Owin.Authentication.IdentityServer.Pipelines.Initialize.LogoutEndpoint.Process(InitializeArgs
args) +244 (Object , Object ) +14
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +490
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName,
PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
+236 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
[TargetInvocationException: Exception has been thrown by the target of
an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object
target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
Object[] parameters, Object[] arguments) +216
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+182 Owin.Loader.<>c__DisplayClass19_1.b__0(IAppBuilder
builder) +93
Owin.Loader.<>c__DisplayClass9_0.b__0(IAppBuilder
builder) +224
Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action1 startup) +897 Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action1 startup) +51
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()
+101 System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
+139 Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication
context) +160
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr
appContext, HttpContext context, MethodInfo[] handlers) +584
System.Web.HttpApplication.InitSpecial(HttpApplicationState state,
MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +277
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
appContext) +369
[HttpException (0x80004005): Exception has been thrown by the target
of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+111 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +719
UPDATE:
The Sitecore items were only pushed to master and I never published to web.
So, in the Connectionstrings.config, I pointed master also to the web database and now the CMS loads fine. (ofcourse without the content items).
Is there a way to fix this other than reinstalling the instance?
| |
Ok guys so the Getting started template is only for headless development, if you are going to be using headless than that is fine although the training is showing you how to do non-headless stuff and is also using a Sitecore 9.3 instance for Sitecore TEN training.
if you want to actually follow along with code and such in the XM/XP 10 for Developers you will need(I'm sure there's other ways but I'm new to Sitecore and don't know them) to install a local Sitecore instance using the Sitecore install Assistant (SIA)
you can follow this guide here:
you will need to be a system admin and have a local sql server set up.
https://www.getfishtank.com/blog/how-to-install-sitecore-10-3-using-sitecore-install-assistant
Microsoft recently made the trust server ssl boolean for connection string default to false, you can remedy this by going in to the jsons in the installer and setting it to true.
once you have it installed you will need to set up a visual studio solution so you can push your code to your local sitecore instance.
I followed this guide here and did not have any issues:
https://sitecorediaries.org/2020/01/09/creating-a-visual-studio-solution/
I would like to point out that Sitecore is a multi billion dollar company by the way. I think the quality of the training and information around set up is just flat out unacceptable.
Feel free to comment on this post and I will help you out if I can.
| Sitecore getting started template does not work with the training
im doing the Sitecore Training XM/XP 10 for Developers.
https://learning.sitecore.com/learn/lp/10/xmxp-10-for-developers
In the training they show me how to use the getting started template, which I've had no trouble getting set up and running. The issue I'm having is that the current getting started templates seem to only be for the headless versions of sitecore, and they seem to not be using the headless version of sitecore in the training itself.
The code provided in the training does not match and the solutions have different projects.
Solution in the training:
My solution created from the getting started template:
Are there any resources out there on how to setup a project that is not headless and or matches the one that they are using in this training so that i am actually able to follow along in my own code?
I am new to Sitecore and have not been able to find anything useful online.
Thanks!
| |
Adding the client id and client secret in the Identity server ~/Config/Sitecore.IdentityServer.DevEx.xml resolved my issue.
| Facing issue with Non interactive Sitecore CLI 5+
I am facing issue while configuring non interactive mode of login for pre-prod environments.
Please let me know the exact steps to do that.
And also, how to configure sitecore CLI in azure?
| |
It sounds like the TDS project is not saving changes or is not being reloaded properly when Visual Studio is reopened. Here are a few things you can try to resolve this issue:
Ensure that the TDS project is saved before closing Visual Studio.
You can do this by selecting "Save All" from the "File" menu, or by
right-clicking the TDS project in the Solution Explorer and selecting
"Save Selected Items".
Check the TDS project settings to make sure that it is configured to
generate code on build. You can do this by right-clicking the TDS
project in the Solution Explorer, selecting "Properties", and then
selecting the "TDS Options" tab. Make sure that the "Code Generation"
section is set to "Auto" or "On Build".
Check that the TDS project is included in the solution's build
configuration. You can do this by right-clicking the solution in the
Solution Explorer, selecting "Properties", and then select the
"Configuration Properties" tab. Make sure that the TDS project is
checked in the "Build" column for the current build configuration.
Try manually reloading the TDS project after reopening Visual Studio.
You can do this by right-clicking the TDS project in the Solution
Explorer and select "Reload Project".
If none of the above steps work, try deleting the TDS project from
the solution and recreating it. Be sure to back up your project before
doing this.
| sitecore items is not loading in TDS project
I am getting the Sitecore templates item in TDS master project using Get Sitecore Items option. It is working as expected. But when I close and reopen the visual studio, the templates items are not shown in TDS master project. can anyone help me to resolve this issue?
| |
After discussion with Sitecore support, I found that this has been fixed in Cumulative hotfix and here is the link
Cumulative hotfix for Sitecore 9.3
Hope this is helpful in case anyone facing same issue
| Sitecore 9.3 versions update date issue
We have set up workflow in Sitecore 9.3 version. After hitting Lock and Edit link on one data source item, new version will be created. This new version will have current date set to Created/Updated fields and this new version is in Draft state which is as expected. There is no change in old version which is in Approved state and all fields are non-editable.
This new data source item is being referenced on a page in one rendering component. In experience editor, we made content update in component and hit the save button. As a result new version of this data source item is created with current date set to Created/Updated fields but in old version current date is also set to Updated field and old version is in Approved state but all fields are editable. There shouldn't be any change in old version. Now new version is in Draft state but all fields are non-editable.
Is this a kind of bug in this Sitecore version OR we need to write some custom code to handle this behavior. If we directly edit item, versioning working properly. This behavior is happening only while editing that item via experience editor.
| |
In addition to Sumit's checklist. When you try to browse the URL https://qa1.url.com/.well-known/openid-configuration and it does not return json then it could also be related to Sitecore license file.
You can find out identity server license file at \Youridentityserver\sitecoreruntime\license.xml. Try to change it with a valid license file and it should get resolved.
Reference: SITECORE CLI LOGIN ERROR - /.well-known/openid-configuration
Hope it helps!
| open id configuration issue with sitecore CLI
getting error while logging into VM with following command:
dotnet sitecore login --authority https://<sitecore-identity-server> --cm https://<sitecore-instance> --allow-write true --client-id <client-id>
| |
Basically I was getting error because Docker Desktop could not reach the internet.
Got to this conclusion after running below command from Run your first Windows container which also gave same error message.
docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022
Resolve the issue by setting InterfaceMetric lowest to 'Wi-Fi' in Network connection by below commands as mentioned in https://github.com/docker/for-win/issues/2760#issuecomment-430889666
Get-NetIPInterface -AddressFamily IPv4 | Sort-Object -Property InterfaceMetric -Descending
Set-NetIPInterface -InterfaceAlias 'Wi-Fi' -InterfaceMetric 1
| Error response from daemon: Get "https://scr.sitecore.com/v2/": context deadline exceeded
Getting below error while running container in windows 11. Hyper-V is enabled.
Keeping XM Cloud base image up to date
Error response from daemon: Get "https://scr.sitecore.com/v2/": context deadline exceeded
Building containers...
WARNING: The SITECORE_XmCloud_dot_TenantId variable is not set. Defaulting to a blank string.
solr uses an image, skipping
mssql uses an image, skipping
mssql-init uses an image, skipping
solr-init uses an image, skipping
traefik uses an image, skipping
Building cm
Sending build context to Docker daemon 11.26kB
Step 1/8 : ARG PARENT_IMAGE
Step 2/8 : ARG SOLUTION_IMAGE
Step 3/8 : ARG TOOLS_IMAGE
Step 4/8 : FROM ${TOOLS_IMAGE} as tools
Get "https://scr.sitecore.com/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
ERROR: Service 'cm' failed to build : Build failed
C:\Hori\XMCloud\xmcloud-foundation-head-staging\up.ps1 : Container build failed, see errors above.
At line:1 char:1
+ .\up.ps1
+ ~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,up.ps1
| |
The behavior you described, where non-administrator users are unable to unlock, edit, or read locked Media Library items, could be caused by a few factors.
Security Settings: First, check the security settings for the Media Library items. Ensure that the appropriate access rights are granted to the user roles that need to perform these actions. Verify that the necessary read, write, and unlock permissions are assigned to the user roles that should have access.
Workflow Configuration: If you have a workflow enabled for your Media Library items, check the workflow configuration. Ensure that the workflow states and actions are properly configured, allowing users with the Super User role or other relevant roles to perform the required actions. Verify that the lock state is not preventing non-administrator users from accessing the items.
Custom Code or Modules: If you have custom code or modules implemented in your Sitecore instance, review them for any modifications related to Media Library item locking or access. Customizations could potentially introduce unintended behaviors or restrictions. Check for any custom pipelines or event handlers that might be interfering with the default behavior.
Check the Sitecore Logs: Check the Sitecore logs to see if there are any errors or warnings related to the Media Library items. This can help you identify any issues that might be causing the behavior you are seeing.
Check the Performance Settings: If the issue persists, it could be due to performance issues. Check the Sitecore performance settings, such as the database connection pool, to see if there are any issues there.
Please check whether you are facing this issue on all environments or on specific environment only..
| Locked Media Library Items Cannot be Read by Non-Administrator Users
Our Media Library items are behaving differently from items in our content tree when locked.
User accounts with the Administrator flag on can, of course, move around as usual. But any other user account (including our Super User type, which is allowed everything except the Administrator role) cannot unlock, edit, or even read Media Library items when they are locked by another user.
If a user tries to select a Media Library item locked by another user, nothing happens for a long time, after which we get a browser alert that says "Please wait while the Content Editor is loading." We have sat with one of our content team to observe and it's definitely not an issue of the page loading.
What could be causing this behavior?
We are on 10.1-update 2
| |
It's not uncommon for SXA indexes to not appear after installation, even if you have installed SXA separately. This is because the SXA indexes are not created by default when you install Sitecore.
To create your SOLR SXA core:
Navigate to your Solr folder (<path_to_solr>\server\solr) and Duplicate the core directory created for sitecore_master_index (or company_name_master_index) twice and rename it to:
• sitecore_sxa_master_index
• sitecore_sxa_web_index.
In those two folders, remove everything except the conf directory.
On the Solr web interface, click Core Admin, and click Add Core to add
sitecore_sxa_master_index. Do the same for sitecore_sxa_web_index.
Make sure that the names of the Solr cores you created match the
settings for sitecore_sxa_master_index and sitecore_sxa_web_index in
Sitecore.XA.Foundation.Search.Solr.config. If you have to rename the cores > you have also to change the id’s in in > Sitecore.XA.Foundation.Search.Solr.config
In Sitecore, log in to the Launchpad, and open the Control Panel.
In the Indexing section, click Populate Solr Managed Schema.
In the Schema Populate dialog, select sitecore_sxa_master_index and
sitecore_sxa_web_index, and click Populate.
In the Indexing section, click Indexing Manager.
In the Indexing Manager dialog box, select sitecore_sxa_master_index and sitecore_sxa_web_index, and click Rebuild.
The reason for creating the cores in SXA is to enable its functionalities to work properly. Failure to create these cores will result in exceptions being thrown when attempting to use SXA or SXA-related functionalities. Therefore, it is necessary to create the cores in order to ensure the smooth functioning of SXA.
| SXA indexes not created after installing 10.3
I have installed 10.3 on my Windows 11 Pro machine by running the PowerShell script - XP0-SingleDeveloper.ps1.
However, that doesn't install SXA.
So, I had to install separate packages for SXA & PowerShell Extensions.
I can now see the options to create Tenant & Tenant Folder in CMS.
But when rebuilding indexes, the sxa indexes are not listed.
I was looking for myinstance_sxa_master_index & myinstance_sxa_web_index.
When I open the Solr portal (8.11.2), even there, these are not listed.
Is this expected?
Do I really need these indexes?
If yes, what additional steps should I perform to get them?
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.