9

I have a few fields in a template, and two of them have template name restrictions. Using the restriction, I get 0 results, and when removed I get all the items I want (plus others I don't)

With templatename or templateid filter:

enter image description here

Without filter:

enter image description here

My drop-link source:

query:/sitecore/content/Americas/SmartSite/Data/Navigation//*[@@templatename='Navigation Items']

I've tried replacing template name with templateid and I get the same result. This only happens in the QA environment, not DEV or local.

When I run the query in XPath Editor I get the results that I expect.

enter image description here

The last suspicious thing is that after saving my template definition, the logs state that indexes were built within a second. That would be the only fast thing about this instance

9
  • So the query you are running you ran that in QA? I assume the template is in QA too. Syntax looks correct.
    – RReilley
    Commented Feb 17, 2017 at 23:12
  • You could also try using &IncludeTemplatesForSelection = Navigation Items. You would specify the path of the items. There are a few more options you can add to exclude folders as well.
    – RReilley
    Commented Feb 17, 2017 at 23:20
  • 1
    You may try to rebuild the link database and search index from the control panel Commented Feb 18, 2017 at 15:06
  • @RReilley yes, XPath editor in QA
    – MStodd
    Commented Feb 18, 2017 at 18:04
  • Just for testing purposes do you get the same issue if you switched the field to a multilist? I just wonder if something is off. Maybe the Sitecore versions are different in Dev vs QA.
    – RReilley
    Commented Feb 20, 2017 at 3:54

1 Answer 1

0

It looks like you are experiencing some unexpected behavior with the template name restrictions in your Sitecore instance. Based on the information you provided, here are a few things you can try to help identify the root cause of the issue:

  • Verify that the templates in question have the correct name and ID. You can do this by checking the template manager in Sitecore and comparing the IDs and names with those in your query and drop-link source.
  • Check the log files in your QA environment for any errors or warnings related to the template restrictions or indexing. This may give you a clue as to what is causing the issue.
  • Try using a different filter or query to see if you get the expected results. For example, you could try filtering on a different field or using a different query to retrieve the items you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.