Skip to main content
added 2 characters in body
Source Link
Hishaam Namooya
  • 9.7k
  • 1
  • 19
  • 37

The content tree is as follows:

sitecore
|_content
  |_Site1
    |_Home
      |_Articles
        |_Category
          |_article1
          |_article2
  |_Site2
    |_Home
      |_Rewards
        |_September
          |_Reward1
          |_Reward2

There is a multilist field and I would like the user to be able to select only Articles and/or Rewards.
Before setting the source query I was trying it in the XPath Builder:

/sitecore/content/site1/home/articles/*/*|/sitecore/content/site2/home/rewards/*/*[@@templateid='{02DB4F77-20CB-463D-BF3A-177C6B6E2DA5}' or @@templateid='{AB86861A-6030-46C5-B394-E8F99E8B87DB}']

/sitecore/content/site1/home/articles/*/*|/sitecore/content/site2/home/rewards/*/*[@@templateid='{02DB4F77-20CB-463D-BF3A-177C6B6E2DA5}' or @@templateid='{AB86861A-6030-46C5-B394-E8F99E8B87DB}']

The first guid is the article template & the 2nd is the reward template. The result only shows articles.

article1
article2

How should this query be to show both articles & rewards.

Any suggestions for Treelist are also welcome.

The content tree is as follows:

sitecore
|_content
  |_Site1
    |_Home
      |_Articles
        |_Category
          |_article1
          |_article2
  |_Site2
    |_Home
      |_Rewards
        |_September
          |_Reward1
          |_Reward2

There is a multilist field and I would like the user to be able to select only Articles and/or Rewards.
Before setting the source query I was trying it in the XPath Builder:

/sitecore/content/site1/home/articles/*/*|/sitecore/content/site2/home/rewards/*/*[@@templateid='{02DB4F77-20CB-463D-BF3A-177C6B6E2DA5}' or @@templateid='{AB86861A-6030-46C5-B394-E8F99E8B87DB}']

The first guid is the article template & the 2nd is the reward template. The result only shows articles.

article1
article2

How should this query be to show both articles & rewards.

Any suggestions for Treelist are also welcome.

The content tree is as follows:

sitecore
|_content
  |_Site1
    |_Home
      |_Articles
        |_Category
          |_article1
          |_article2
  |_Site2
    |_Home
      |_Rewards
        |_September
          |_Reward1
          |_Reward2

There is a multilist field and I would like the user to be able to select only Articles and/or Rewards.
Before setting the source query I was trying it in the XPath Builder:

/sitecore/content/site1/home/articles/*/*|/sitecore/content/site2/home/rewards/*/*[@@templateid='{02DB4F77-20CB-463D-BF3A-177C6B6E2DA5}' or @@templateid='{AB86861A-6030-46C5-B394-E8F99E8B87DB}']

The first guid is the article template & the 2nd is the reward template. The result only shows articles.

article1
article2

How should this query be to show both articles & rewards.

Any suggestions for Treelist are also welcome.

Source Link
sukesh
  • 3.3k
  • 3
  • 29
  • 78

How to query multiple datasources & multiple templates in sitecore query

The content tree is as follows:

sitecore
|_content
  |_Site1
    |_Home
      |_Articles
        |_Category
          |_article1
          |_article2
  |_Site2
    |_Home
      |_Rewards
        |_September
          |_Reward1
          |_Reward2

There is a multilist field and I would like the user to be able to select only Articles and/or Rewards.
Before setting the source query I was trying it in the XPath Builder:

/sitecore/content/site1/home/articles/*/*|/sitecore/content/site2/home/rewards/*/*[@@templateid='{02DB4F77-20CB-463D-BF3A-177C6B6E2DA5}' or @@templateid='{AB86861A-6030-46C5-B394-E8F99E8B87DB}']

The first guid is the article template & the 2nd is the reward template. The result only shows articles.

article1
article2

How should this query be to show both articles & rewards.

Any suggestions for Treelist are also welcome.