Note that there are some explanatory texts on larger screens.

plurals
  1. POOrchard CMS - Query based on values from ContentPicker
    primarykey
    data
    text
    <p>EDIT: Rephrased issue</p> <p>I think there is either a bug or I am doing something wrong.</p> <ol> <li>I add a field to the type Blogpost. This field is of type Contentpicker. I call it Related Page.</li> <li>Then I create to regular pages (ContentType Page).</li> <li>I create 4 blogposts. Two blogposts get PageOne as selected value in the RelatedPage field. The other two posts get PageTwo as selected value in the RelatedPage.</li> <li>Now I create a query with filter ContentType is BlogPost. And a filter with Blog Post.Related Page equals {21} (that is the Id of PageOne).</li> </ol> <p>I would expect to get results BlogPostOne and BlogPostTwo. Instead I don't get results. Actually I wanted the pageid to be retrieved from the page the widget is placed on but couldn't get it to work, so I reduced back to a predefined value instead of dynamic for the filter. But like I said no results.</p> <p>So is the query wrong and how should I do it then. Or is there a bug with filters for ContentPicker fields.</p> <p>P.S. I will also submit an issue in Codeplex.</p> <p><strong>UPDATE</strong> In Tokenizer all the values that contain { } are being seen as tokens and therefore are replaced. The problem is that the Ids of content items in a contentpicker field are stored with accolades. So when having {21} as the value for the filter, 21 gets tokenized and since there is no value for this token the value becomes empty. When skipping the tokenizer it works (while debugging). But one cannot skip the tokenizer, because it is very legitimate that there is a token present. So I believe there is a bug with either the tokenizer, or the way the ids are stored in the contentitem field for contentpicker. I think it can be solved by changing the contentpicker to store numbers separated with comma's but without the accolades.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload