6

We are running web 8.5 with the latest content delivery setup. We have a component X which has two fields (both are regular content fields and not metadata): Key, and Value

The key is a keyword from a category and the value is a regular old text field. There is a DCP (named "Y") which renders the value of the component in a tag and nothing else. Once the component is published to the broker as a DCP, we want to be able to get the component presentation using the content service's OData URLs (/client/v2/content.svc/???). We have the key, the template ID and the publication ID.

Additionally, we don't want to have to republish the categories themselves. We only want to republish the DCP. We noticed that the /Keywords call appears to pull data from the “TAXFACETS” broker table and it works only when we publish whole category. What content service URL, (or combination of URLs) would we use to achieve this? Is it possible given our current configuration, or do we need to modify the Component/Template in any way to make this work?

1 Answer 1

2

After looking through all of the API calls and attempting each one of them to see the kind of results I could get, I determined that this is not possible with the content service's Odata API. Here are a few possible solutions to get around this issue:

  1. Update the component template to include the keyword inside of it (usually in an HMTL comment so that it is not rendered on the page). Then you can construct a query that filters based on the text in the component presentation. Of note is the fact that this option leaves HTML comments in the CP which will be visible to a tech-say website visitor, and it will slightly increase the size of the HTML page. This is a really clever and easy solution to the problem as long as the keyword names do not contain sensitive information.
  2. Create some event system code that automatically publishes the categories and keywords to reduce the risk of errors.
  3. Migrate the query to the CD API which has more power to query based on the ITEMS_CATEGORIES_AND_KEYWORDS table.
  4. Update the schema and migrate the keywords from content fields to metadata fields for each component which will make the keywords easier to query on by using the CustomMetas functionality. (This post describes more details: http://www.tridiondeveloper.com/content-delivery-web-service-odata-fundamentals)
1
  • 1
    Feels like option 4 would be a better fit.
    – Neil
    Commented Jun 12, 2018 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.