Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
My use case is almost identical to the one mentioned in this support issue.
The only differences being that the content type is a basic page and the term reference field is called field_share_to
which in turn references a taxonomy vocab called Sites. I have only two sites; 1 server and 1 client.
I am struggling to configure the correct path for term reference field, using a value for the term ID(64).
This is the first time I have needed to understand anything about json:api and I ask this question as a site builder rather than someone who spends a lot of time working with code.
Comments
Comment #2
MrPaulDriver CreditAttribution: MrPaulDriver commentedComment #3
GrimreaperPlease see the following JSON:API documentation page https://www.drupal.org/docs/8/modules/jsonapi/filtering
And maybe test this module https://www.drupal.org/project/jsonapi_explorer
I would say something like: field_share_to.entity.tid or field_share_to.entity.id
I agree that setting filters on channel is something that needs improvements, there are one or more issues about that in the Entity Share issue queue.
Comment #4
MrPaulDriver CreditAttribution: MrPaulDriver commentedSuper helpful. Thank you
field_share_to.entity.tid = 64
Comment #5
MrPaulDriver CreditAttribution: MrPaulDriver commentedOne more question if I may.
Rather than a taxonomy term, let's assume I had a boolean field called
field_share_to_all
What would the be path for the field and what would be it's value when checked?
And yes I will take a look at jsonapi_explorer, thanks for the tip.
Comment #6
GrimreaperHello,
A boolean value when checked is 1.
There are examples on https://www.drupal.org/docs/8/modules/jsonapi/filtering#s-1-only-get-pub..., already mentioned in my previous comment.
Please read the doc and try on your website.
If you want dedicated support hours, you can contact me and I will relay to my company to have a contract for that.
Comment #7
GrimreaperComment #8
MrPaulDriver CreditAttribution: MrPaulDriver commentedThanks again.