Hot answers tagged

6

The Page Design that you're seeing isn't processed by the React application, it's just part of the default Item serialization. The power of SXA's Page + Partial Designs will translate into a list of placeholders, components, and nested placeholders in the JSON, no different than a non-SXA site. You need to start off with ensuring your JSS Layout definition ...


6

You can disable tracking per site by using enableTracking="false" To do this in SXA, go to Site Grouping, then use the Other Properties named value field to add that in. Official Documentation links: https://doc.sitecore.com/xp/en/developers/101/platform-administration-and-architecture/enable-disable-the-xdb-and-the-tracker.html https://doc....


5

Yes, there is an embedded object called o_pagemode. You can use this like o_pagemode.is_experience_editor in an if statement. You can find all the options for the o_pagemode here: https://doc.sitecore.com/developers/sxa/101/sitecore-experience-accelerator/en/the-embedded-items-and-objects-in-the-scriban-context.html. The following lists notable properties of ...


5

This is not an SXA or Scriban problem, this is a CSS problem. You can use the :nth-child() psuedo-selector to apply a style. For example, if you want all even-numbered divs to have your .reversed css applied, then instead of having: .landing-feature-card.reverse { /* some styles here */ } you could use: .landing-feature-card:nth-child(even) { /* ...


5

Sample Here is an example of how I used tags for listing departments associated with media items. {{ if i_item.SxaTags != "" }} <span> Department: </span> {{ tags = [] }} {{ for i_tag in (sc_followmany i_item "SxaTags") }} {{ tags[tags.size] = i_tag | sc_field "Title" }} {{ end }} {{ tags | array.sort | array.join &...


4

To achieve this you have the field "Field used as link target" in the Variant Definition item. Then when you select the "wrapped" option in "Is link" field for your image variant field, it will wrap your image with the link provided in the Variant Definition And this link will have the target properties. Hope it helps.


4

If you want control over the markup using C# then you can try something like this: <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <renderField> <processor patch:instead="processor[@...


4

Media Request Protection only kicks in when it needs to. It is designed to prevent media specific parameters from being manipulated (e.g. specifying a MaxWidth for an image of 10248000, forcing Sitecore to fill its media cache with useless scaling of images). Therefore if no parameter is present on your media url, no hashing is required. Sitecore will server ...


4

You can set this up with Creative Exchange Live. When you export, you will see that any existing scriban template items will be exported to a root folder in your zip file. The default is -/scriban If you don't want to do a full export, say for example if you are using the SXA CLI to create the theme, just create a folder at the same level as your theme ...


4

TL;DR Because you are not using supported SPE package. Make sure you downloaded it from dev.sitecore.net. Right now package on github is insufficient. More info in Sitecore Experience Accelerator compatibility tables Explanation Starting from SXA 10.2 - items will be delivered/stored inside dat files (not in SQL). Every item that has a dependency on other ...


3

This is a known issue with SXA. A workaround could be: After cloning rendering and installing the module in the site node, go to Presentation -> Available Renderings. There you'll see, rendering with the name of your website. Rename this rendering with the name of your cloned rendering. Save and publish.


3

I am assuming you are using the standard (ootb) search results component. That component is using rendering variants: $site/Presentation/Rendering Variants/Search Results The default rendering variants will show the title of the page (or the display name). If you want to show extra fields, you should create your own variant that displays this data. Note ...


3

This is how query strings works. Browser needs to know which part of url is protocol (knows it as url contains // and http or http or ftp before), which part is domain (knows it because of . like .com, .net, ...) and ? is used for query strings so everything which is after this character is considered as query string to pass some parameters towards server. ...


3

I was able to accomplish this in a few steps in SXA 9.3. This approach implements the ISearchService included with SXA. We're basically extracting code that is used by the SearchController. Step 1 : Implement the custom search function. Add this to your IGenerateScribanContextProcessor. private delegate IEnumerable<Item> SearchItemsDelegate(Item item, ...


3

The Container component is not a Variant component, so you can't create variants for it. You have 2 options, the best as has already been mentioned, just add a Style option for the Container component and use that to add the background colors. It's the simplest and easiest to use option for content authors. The 2nd is to clone an existing variant component, ...


3

You should have your custom model inherit from RenderingModelBase. Something like: namespace MyCustomApp.Models { public class MyCustomModel : RenderingModelBase { public string MyField { get; set; } } } Then, in your view, you would have: @model MyCustomApp.Models.MyCustomModel


3

I don't think you can do this ootb. One solution would be to create an extra Scriban context function. That is not hard to do - you can find how on https://ggullentops.blogspot.com/2019/11/custom-sxa-scriban-extensions.html This function would return all the language versions of a given item. You can loop through the results. It would look something like: ...


3

There are few options: Use Sitecore RESTful API. It doesn't matter SXA or not, but you will be able to get items in JSON format. Use JSON device to get page data. SXA allows you to model your data in JSON. You are able to use special JSON renderings to model data in a way that you need. But even if your website uses default renderings, you can use the SXA ...


3

As Mark mentioned in his comment you should use the SXA tokens to achieve this. You can find a list here: https://doc.sitecore.com/en/developers/sxa/101/sitecore-experience-accelerator/the-sxa-pipelines.html Useful ones for sources in templates could be: $tenant - path to the current tenant. $site - path to the current site. $home - path to the current site ...


3

If local or page relative SXA data sources are not resolved you need to resolve them manually. Run resolveRenderingDatasource pipeline: ResolveRenderingDatasourceArgs renderingDatasourceArgs = new ResolveRenderingDatasourceArgs(YOUR_DATA_ROURCE_STRING); renderingDatasourceArgs.CustomData.Add("contextItem", CONTEXT_ITEM); CorePipeline.Run("...


3

No, you should not do such things! All database operations should be done through the Sitecore APIs. SXA is also using Sitecore APIs and it is never accessing the database directly. Sitecore is doing a lot of processing around basic database operations (e.g.: while saving an item) so you can break the database easily when you will start to manually ...


2

Yes, you can, just create an Overlay page with your Login component inside. Then add a Link component and point it to your overlay page, don't forget to add the class "Links Shown in Overlay" to your Link component. Hope it helps.


2

With SXA jQuery is already part of the core theme. Its included in the /sitecore/media library/Base Themes/XA API base theme. You are most likely not using the XA framework to inject dependencies in your custom JavaScript files. You need to make sure that you follow the SXA pattern for creating JS scripts like this: XA.component.myComponent= (function ($) { ...


2

You have to add the IsRenderingsWithDynamicPlaceholders: true in Controller or View Renderings.


2

Instead of Droplist, you can take Droplink because Droplist holds item name but Droplink holds the ID of that item, later on from that id you can get Item and access its field. LookupField address= (LookupField)mainPage.Fields["Address"]; Item addressItem = address.TargetItem; string displayName = addressItem.Fields["DisplayName"].Value; ...


2

It seems the issue has been fixed in later versions of SXA so sitecore might be able to provide a hotfix for this otherwise you would need to overide the methods. If you look at 10.1 implementation the method looks like this: public static string BuildAssetPath(this Item item, bool addTimestamp = false) { MediaItem mediaItem = (MediaItem) item; ...


2

You need to check this part of the documentation: https://doc.sitecore.net/sitecore_experience_accelerator/setting_up_and_configuring/configuring/extend_search#_Extend_search_to_3 This explains how to use a link type field in the facets. Add a computed field and use that fieldname in the facet: Add the following definition to your search configuration file: ...


2

bgsi/public/group_scheme/index.jsp Sounds like Java Server Pages. Sitecore is based on .Net and doesn't use this page extension. That is why I assume that it could be added by some external sitemap(it is a built-in feature of SXA). I suggest you check external sitemap settings for your SXA website: Open Settings item under your root SXA website Look for &...


2

Maarten Willebrands has just released a module that can do this: https://www.maartenwillebrands.nl/2021/02/23/sitecore-sxa-scriban-includes/ Within plain Scriban it is possible to use includes, which allows you to render another Scriban template where you call the include. This makes sure you can re-use parts of your templates, and makes sure you can define ...


2

Code provided by Mark Gibbons works in general, but it has major 2 issues: Datasource will not be moved through the workflow if you haven't set initial state. if (item.Access.CanWrite() && (!item.Locking.IsLocked() || item.Locking.HasLock()) && ShouldProcess(innerItem, item, rulesRawValue2)) { ...


Only top voted, non community-wiki answers of a minimum length are eligible