Score:0

View to return multi-nested criteria

cn flag

My website has articles. Each article has a field 'region restricted' (default is OFF). I want to on my view display all articles which is not restricted but also show articles that are restricted and has a translation in the active language the website is currently set to.

For example, if the site is currently set to french, show me all articles regardless of translation where the region restriciton is off but also include in the dataset articles that are region restricted and has a translation for french. I am even happy to not work on translations but say outright that the article must have no restrictions, the language must just be set to french.

My view criteria is as follows. As things stand now, I am not returning any articles except for 1 article when I have selected french as my language (which is also a region restricted article for french).

enter image description here

In SQL I would have assumed something like:

`... AND (`restricted`=0 OR (`restricted`=1 and `langcode`='THESITELANGUAGE'))

Can this be done? What am I doing wrong?

ru flag
Did you add field `restricted` later on? If you add a new field later on, older, pre-exisiting nodes will not magically get values from new fields. Until you save them at least once, old nodes' `restricted` will be `NULL`, which is not the same as number `0`
mauzilla avatar
cn flag
I did yes and that was the solution :)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.