Podczas korzystania z kwerendy Sitecore, musisz wymykać nazwy elementów za pomocą myślników. Od SDN:
Items with dashes in names (“-”) should be included in “#” symbols. Please use such syntax: /sitecore/content/Home/#About-us#. Otherwise you may get the following error: Invalid lookup source "/sitecore/content/TestSiteB/Home/About-us": End of string expected at position 38. Also, an item name should be included in “#” symbols if it contains “and” or “or” word and is used before “//” symbols. For example: "/sitecore/content/Home/#news and events#//".
UPDATE: I potwierdziły, że odnosi się to do szybkiego Query również.
End of string expected at position 27.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Sitecore.Data.Query.ParseException: End of string expected at position 27.
Source Error:
Line 21: protected void Page_Load(object sender, EventArgs e)
Line 22: {
Line 23: Sitecore.Context.Database.SelectSingleItem("fast:/sitecore/Content/Home/Test-Item");
Line 24:
Line 25: Model = Sitecore.Context.Item;
Ten sam kod działa poprawnie z # ucieka #:
Sitecore.Context.Database.SelectSingleItem("fast:/sitecore/Content/Home/#Test-Item#");
powiązane pytanie: http://stackoverflow.com/questions/3687405/escaping-reserved-words –
Ktoś wie, jak uciec od znaków specjalnych używanych w polach tekstowych, takich jak apostrof w opisie elementu treści? http://stackoverflow.com/questions/16847831/sitecore-fast-query-how-to-search-for-text-containing-special-charples-such – longda