Using a bucket as a data source for a droplink / tree field

I am trying to allow content editors to select an item that is in a bucket in a droplink field, but I cannot find a field type / datasource that allows this.

I need to allow the user to select a single item (not a multi-sheet), the items are in the bucket as the number of items can be huge and the api search will be most useful for editors.

Is there a field or data source query that will allow the search field to select a single item in square brackets?

+3


source to share


2 answers


The simplest solution is to use the Sitecore multi-sheet with a search box.

First you need to set the source of your field to display items in your bucket of a specific template.

Example: StartSearchLocation = {11111111-1111-1111-1111-111111111111} & Filter = + _ templatename: sample item

Here is an article describing how to set the source of your field: Sitecore 7 Field Types



If you need to restrict the selection to one element, you need to apply some regex as well. To do this, you need to enable the standards values ​​in the view tab so that you can change the data section.

In the data section, add the following regex: ^ ({[^}] +} \ |?) {0,1} $ and add the validation text.

Example: enter image description here

This article provides more information: Limit Selected Items in Sitecore Multi-Sheet Box

+2


source


Just in case someone comes across this like me, you can also use a query in the source field to filter items in the droppink.

query:/sitecore/content/Home/YourBucket//*[@@templateid='{your-template-guid}']

      



You can also use @@templatename='Your Template Name'

Keep in mind that if your bracketed items are not numerous (for some reason) the suggested answer is probably better as it provides search and will not create a massive dropdown list of items.

0


source







All Articles