Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter RelationShip entity by other field than Title #982

Closed
mangiove opened this issue Oct 13, 2016 · 13 comments
Closed

Filter RelationShip entity by other field than Title #982

mangiove opened this issue Oct 13, 2016 · 13 comments

Comments

@mangiove
Copy link

It seems that relationship filter in visual query does work only filtering on title field.
It is possible to implement a relationship filter on the other entity fields?
I know that the alternative would be use LINQ, but visual query are so cool and using it you can have more slim templates without using LINQ, at least for simple things.
The problem as at now is that modifying the entity title field you have to modify the filter too, this will not happens filtering it for example on id.
Thanks

@iJungleboy
Copy link
Contributor

This should be fairly easy to do - the data-source already implements it, so it must be only a small thing to surface this feature into the visible settings...

@iJungleboy iJungleboy modified the milestone: 2sxc 8.07 - New Data Sources and Improvements Oct 17, 2016
@mangiove
Copy link
Author

mangiove commented Oct 17, 2016

I don't know if this can be already done otherwise but I'm just trying to sort this out with no luck :(
It would be also usefull if you can set multiple relationship filters, maybe comma separated, to have just one output stream...

@iJungleboy
Copy link
Contributor

@mangiove not sure what you mean, could you please provide a real example with real terms (so no generic terms, better to say "book", "author" etc. instead of "relationship" "Entity"...

@mangiove
Copy link
Author

mangiove commented Oct 17, 2016

@iJungleboy Ok, sorry, I already asked on stackoverflow, basically I mean to relationship more than one object and have in out one stream instead of two.
Example:
Books Stream
Author Stream

I would like to relationship Author A and Author B and get out just one Book Stream.
As of now I'm able to get the relationships but I have to output two streams. "Books of author A" and "Books of author B".

Maybe this could be done using just one relationship object and filtering by authors separated by comma (Author a,Author B) ?

@iJungleboy
Copy link
Contributor

So if I understand you correctly, you would like to check multiple values on the relationship, a bit like
Where Author = "Frank" Or Author = "Samuel"

@mangiove
Copy link
Author

Exactly, I would like to check multiple values and stille have only 1 stream, cause they are always books in out...
At the moment I managed to add two filters having two streams of books in out...

@mryckman
Copy link

Just to jump in here... I have a related use case around "Tags". We have a content type "Tag" that is referenced in a few other content types. It would be great if, in the relationship filter, it was easy to say basically the content type "Article" has a field "Tags" with multiple values of "Tag". Then, the module uses the content type "Article View Settings" that has a field "Tags" for what articles should display. I would love to be able to use the relationship filter to basically say "Show any articles where the 'tags' field contains any of these tags..."

I think this is basically the same thing discussed here...

@kingjordan
Copy link

kingjordan commented Jan 26, 2017

I would love this feature as well,

LIke if a "product" has a relationship to content "status" of either "New" or "Featured" pass both streams into valueSort and have one stream from the ValueSort into the CacheAllStreams or Target View or API

Might need a datasource of "CombinedStreams" that works if incoming streams are expecting the same "type"/content

@iJungleboy
Copy link
Contributor

@kingjordan
If a combinedstream is a real requirement, pls find a good user story and open a new issue.

@iJungleboy iJungleboy modified the milestone: 2sxc 08.0x.00 - New Data Sources and Improvements Jan 27, 2017
@kingjordan
Copy link

Okay, one clarification before I do that, this was just a suggestion I made without really thinking it through. Is there a way to have a relationship filter match more than one value. That is the real issue I want to resolve. Or rather return all records where a relationship has been defined and ignore records where no relationship was selected.

I just suggested the combined stream because it seemed like it could solve other issues. For example a simple product catalog where the client wants a page to display "products" from more than one "category"
Do you think this is worth me opening a user story issue?

@iJungleboy
Copy link
Contributor

If you want to provide code and do a Pull-Request, better open a new issue. Otherwise best leave it here for now, as I believe that these are various issues at the same time, but external people couldn't differentiate correctly, namely:

  1. Filter, but asking the child-item to compare the value not against the title, but against another property
  2. Filter with another operator on the relationship, so things like
    1. Is-Relationship, meaning that it has exactly this one item in it (current mode)
    2. Equal-Relationship, meaning that if multiple criterias are given, then the parent must have exactly the same amount of children, each fitting one criteria
    3. Contains-Relationship, meaning that of all the items in this relationship, at least one has a match
    4. Not-Contains-Relationship - meaning that neither child matches
    5. Either-Or-Relationship - meaning that with multiple criterias, one should match
    6. Neither-relationship - meaning that with multiple criterias, neither matches
    7. ...
  3. Direction change - to compare not the child, but parent-relationships
  4. ...

@kingjordan
Copy link

That makes sense, I'll leave for now,

thanks again

@iJungleboy
Copy link
Contributor

All ready :) will be released today in 2sxc 9.9

@iJungleboy iJungleboy moved this from WIP to Ready For Review in 2sxc 9.07 to 9.14 LTS Nov 21, 2017
@iJungleboy iJungleboy moved this from Ready For Review to Released 9.9 in 2sxc 9.07 to 9.14 LTS Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
2sxc 9.07 to 9.14 LTS
  
Released 9.9
Development

No branches or pull requests

4 participants