12

There's already answer to similar problem on Stack Overflow: https://stackoverflow.com/questions/21452260/sitecore-tree-list-datasource-versionexist In a nutshell, what you need to do: Create DataView which will be responsible for filtering non-existing items LanguageFilteringMasterDataView : MasterDataView Override method GetChildItems where you can filter ...


10

This will require customization. Luckily for you, Kam has an example available at http://kamsar.net/index.php/2015/05/A-Multiple-Root-Treelist-Field/ This should do the trick.


6

The reason only the first result is available for selection is because the treelist query sets the root item for selection, not the available list of items. Instead you should use enhanced syntax using Parameterized datasource, which allows you to add some additional restrictions as well as setting the root node. datasource=/sitecore/content/location/to/...


5

Not to self-promote, but I actually wrote a blog post on how to create a Multi-Root Treelist a little while back, based on Kam's post on multi-root Treelists, enhanced with support for using data source parameters with Sitecore Query and also displaying full item paths next to the item names in the tree. Implementation: In addition to the code, don't ...


3

In case anyone wants another solution. Viacheslav from Sitecore support suggested the following which is copying existing Treelist code and adding IDs of unwanted items to the ExcludeItemsForDisplay property. I find Szymon/Ben Golden solution to be more elegant but no harm in having multiple options. Solution Create a class for your custom field. Use a ...


2

If item.Fields["Field Name"].Value = "some string"; throws null reference exception and item["Field Name"] = "some string"; does not throw the exception, it means that the item doesn't have a field called Field Name. Check if you're editing the correct item and if the field name is correct. Most probably the real field name is different (custom ...


2

Try to apply datasource query like this - datasource=/sitecore/templates/Page Templates|/sitecore/templates/Item Templates&IncludeItemsForDisplay=Template1,Template2,Template3&ExcludeTemplatesForSelection=Template Folder&IncludeTemplatesForDisplay=Template This will give you multi-root paths.


2

You have to use either datasource= (and not a query). Or a query:. You can't mix them. You can't mix additional parameters when using query:. Unfortunately, as the code is currently implemented, you cannot specify both a query AND parameters to restrict the items. Source: Specifying query and parameters for Sitecore Treelist Field Source For your use ...


1

If I'm reading that tree right, then your problem here is that by excluding the Catetgory item in the display, Sitecore can then not show any children of a Category So take this list: category1 --> Article --> item1 --> --> Ads --> item1 --> item2 --> Video --> item1 ...


1

For multiple datasource location, for a Multi-list field, you should use 2 ||. So, your query will be as follows: sitecore/content/site1/home/articles/*/*||/sitecore/content/site2/home/rewards/*/*[@@templateid='{02DB4F77-20CB-463D-BF3A-177C6B6E2DA5}' or @@templateid='{AB86861A-6030-46C5-B394-E8F99E8B87DB}']


1

If you want to give the option to select from multiple datasource, then you can create a custom control. Create new item MultiDatasourceTreelist using /sitecore/templates/System/Templates/Template field type template in core DB in this location /sitecore/system/Field types/User Defined/MultiDatasourceTreelist Create a class MultiRootTreeList public class ...


1

The default Treelist does not support selecting all children at the same time. If you are going to create your own control, be mindful of the implications of selecting all of your children's nested children - they could amount to a large number of items. Perhaps your custom control could be configured to only "Select All" the 1st level children.


1

I am not sure if this can be done, and I don't think it's a good idea to make one field dependent on the other. Like what Dan mentioned, there would probably be issues around updating the 2 different fields at different scenarios. I suggest you use a tree list field type for this and utilise IncludeTemplatesForSelection option to limit users to choose only ...


1

Rendering parameters are stored as name-value-collection (like a query string) with just the raw value - which for a multi-list field is a pipe-separated list of IDs. You could change your GetParameter() method to something like the following, to get a list of items: public IList<Item> GetParameter(DynamicPlaceholderRenderContext context, string ...


1

If you are talking about this button on the Link List: Than it's custom edit frame button which is located /sitecore/content/Applications/WebEdit/Edit Frame Buttons/Link/Insert Sibling in the Core database. It's using Sitecore.XA.Foundation.Editing.Commands.WebEditNew command. Take a look there into that class. Create new one, use the same, change what you ...


1

You should use the Sitecore.Mvc.Presentation.RenderingModel as your model and then retrieve a Sitecore context item from it, rather then defining the Sitecore.Data.Items.Item as a model. So, you should change your model definition to this: @model Sitecore.Mvc.Presentation.RenderingModel P.S. Your question is covered quite well by this community forum q/a: ...


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