15

DataSource Location inside rendering parameters has different context. You could achieve your goal by extending resolveRenderingDatasource pipeline. Allows developers to override the default logic for resolving the data source for renderings. Pipeline args type is: ResolveRenderingDatasourceArgs and it contains: public string Datasource { get; set; } ...


12

Would that work for you? ancestor-or-self::*[@@templateid='{website-root-template-id-here}']/*[@@templateid='{shared-content-template-id-here}']/*[@@templateid='{contacts-node-template-id-here}'] This'll travel up the content tree to the nearest website root node (from any page) and then down to the respective Contacts node.


10

You could create a new template to create datasource items that bundle your "multiple items" (in separate link type fields, or with a multi-select type field - as you want). This way you are able to set one item as datasource and find all your items on that single datasource. The benefit of keeping the datasource approach is that datasources can be ...


10

Don't overwrite the Sitecore.Context item with the one you are fetching for the wildcard. Keep the wildcard item as the context item. Instead, put the product item in a sort of wildcard context. You Helix architecture, you can put this in a foundation project. public static Item WildcardContextItem { get => (Item)HttpContext.Current.Items[...


8

To answer your question: branch templates are the way to go, here. However, branch templates, alone will not give you all you need. I have actually written a rule to provide this "branch preset" functionality, and it is currently in use on a Production site. Branch Presets The term Branch presets refers to creating a branch template with the ...


6

I'm going to try and make this not a link only answer. What you are trying will not work because the renderings fields (shared and final) want to store the ID of the data source item. If you just type in a path to an item that does not exist, it will not be able to work out an ID. If you want to make sure that Datasources are set when the item is created, a ...


6

I can think of two options to solve your issue: Create some custom code to make a "query" possible together in the datasource. Luckily for you that is already been done and well documented. Unfortunately as Jammykam correctly pointed out, this won't completely fix your as the TreeList can only accept one parent node. So this would actually come down to a ...


6

You can access MongoDB directly through the C# driver: string connectionString = ConfigurationManager.ConnectionStrings["analytics"].ConnectionString; var client = new MongoDB.Driver.MongoClient(connectionString); var database = client.GetServer().GetDatabase("your_database_name"); var contacts = database.GetCollection("Contacts"); var results = ...


6

I agree with you, datasource count sometimes makes no sense. But from what I know there is no config which you could use to hide this functionality. You can remove this call by editing this file: sitecore\shell\Applications\Page Modes\ChromeControls.js Find function renderDatasourceUsagesCommand and replace it with: renderDatasourceUsagesCommand: ...


5

When you specify the datasource in the Data Source field of the Rendering item definition, you effectively set the "default datasource" for that component. If you do not specify the Data Source in Control Properties in Experience Editor mode (or Presentation Details in Content Editor) then the datasource you specified on the Rendering item definition will ...


5

You can do that in a few steps: Rebuild your link database Search for datasource items for example by template id For each item check if it has referrers Delete item The code can looks like this: public void Cleanup() { using (new SecurityDisabler()) { var coreDb = Factory.GetDatabase("core"); var masterDb = Factory.GetDatabase("...


5

I just put a ticket in with Sitecore for this last week. Here is the fix from Sitecore. The fix allows you to pick how long the call will wait before it return a *+ result with no count. The behavior you reported was registered as a bug in our bug tracking system. Please use the link below to download the patch fixing your issue: https://sitecore....


4

If you will open for example Sitecore.XA.Feature.PageContent.config you will see there <autoDatasourceRenderings> section. You can use that section and put there your rendering ID - this will automatically create data data source for you. When local datasource will be created, the Data Source field inside of your rendering properties should have ...


4

Just to add to the discussion, in SXA they only use getRenderingDatasource to create the Page data folder and adding the global and page data items to the DatasourceRoots object. SXA creates the datasource item automatically in the Add rendering command. You can find the code in the assembly Sitecore.XA.Foundation.Editing in the function Sitecore.XA....


4

What you actually need to do are two things: Create the datasource item Prevent the dialog from appearing Creating the datasource is done in the getRenderingDatasource pipeline. Add a processor before the CheckDialogState. In that processor you can put some logic to determine that you actually want to create an item. Once you determined you want to create ...


4

There are multiple ways that you can do this. But you are on the right track with putting the value in app settings and changing the values on deployment (not build). The implementation will depend on your deployment tooling. I will give you an example using Octopus Deploy: Create your settings in a config file. As this is a Sitecore site, I would create a ...


4

So it sounds like you are trying to get access to a datasource (Article) item as well as the current context item (WebPage). To do that, you would need to use a controller rendering. And within that controller rendering, you would want to have code that looks something like this: public ActionResult Display() { var model = new ArticleViewModel(); ...


4

Long story (and quite a few checks, verifying code, ...) short: it was a very stupid issue. But one that can occur if you don't think twice about your datasource query. Browsers have a maximum length for their url :) I was using Chrome which allowed me to have the url just a bit longer than the Edge my customer is using. That's why they saw it sooner.. ...


3

I agree with Chris Auer (see comments on the OP) that Sitecore should be updating these references for you, even if the reference is a path. That issue should be investigated, and this solution does not seek to dissuade you from finding the cuase of that issue. However, I have experienced issues like this that did not actualize (or, at least, were not ...


3

You are able to use parameter templates and specify as much datasource as you need: Create a new template that uses “/System/Layout/Rendering Parameters/Standard Rendering Parameters” as a base template. Create the template fields (Datasource 2, Datasource 3, etc.) the same way you will do with any normal template. By using Standard Rendering Parameters as ...


3

To get Sitecore to resolve datasources using custom logic, you can add a pipeline processor to the resolveRenderingDatasource pipeline in Sitecore.config: <resolveRenderingDatasource> <processor type="Example.DataSourceService, Example"/> </resolveRenderingDatasource> The DataSourceService processor can then inject any custom logic it ...


3

You can create a custom processor in resolveRenderingDatasource pipeline: <!-- Allows developers to override the default logic for resolving the data source for renderings. --> <resolveRenderingDatasource> ... <processor type="MyCustom.Project.Processors.ResolveRenderingDataSource, MyCustom.Project" /> </...


3

You need to overwrite (create a new) AddRendering command. As you can read here the dialog is opened in that command and the only way to really change the logic there is create you own. As shown in the blog, it can be done but be careful when upgrading as you need to "copy" some Sitecore code. The trick is to send a WebEditResponse with the correct ...


3

The "No Code" approach You can control the dialogue that pops up after adding a rendering. Navigate to your rendering and find the "Open Properties after Add" field. Set it to "No". Sitecore should not be popping up any property dialogues with this set. If you want to avoid Sitecore popping the "Select Associated Content&...


3

I think that the most flexible way to achieve what you want is to use a branch along with the Sitecore Smart Commands module. This module updates links when copying, duplicating, or creating from a template so that references to sub items correctly point to the new copies of those items after the the operation is completed. For your case, as long as the ...


3

This is a feature that's been kicking around the Sitecore community for a while now. To get the feature you're asking for, creating the /Components folder automatically as a subitem of the page you're working on, you need to modify the Layout field. public class CreateContentFolder { protected const string CONTENT_FOLDER_TEMPLATE_PARAM = "...


3

It is pretty simple: Your datasource location (which you need to define in the Footer Rendering Item) will look like below: query:./ancestor-or-self::*[@@templatename='Home Item Templatye Name']/Global Content/Footer Global Contetn|./Footer Local Content You need to correct paths and Home page template name. See this article: http://firebreaksice.com/...


3

This is going to be a horrible linky answer (Sorry moderators its too much code to put in an answer). But Sitecore's habitat example site that does this for assets. In the foundation.assets project, it gets styling and JavaScript from renderings and page content to assemble later on the page. Specifically it is this processor in the mvc.getPageRendering ...


3

The manifest API is a JavaScript API; we just provide a default input via YAML. You can modify the handling in /sitecore/definitions/*.sitecore.js to source content from whatever you like, including multiple items in one JS file. Example here, note that the manifest contains TypeScript typings to make constructing objects easier.


3

I used the rules engine to fix this. I created a rule under Item Saved (/sitecore/system/Settings/Rules/Item Saved/Rules/Language Fallback) that sets the enable item fallback to true on every save. It looks like this: where the item is the my-root-item item or one of its descendants set __Enable item fallback value to 1 You can add any condition you ...


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