0

I'm working on a site with a lot of traffic, and we're trying to avoid broker queries on meta data as some load tests have caused a server overload.

I'm trying to build a dynamic offers and incentives system, which renders out offer content based on a url variable in various areas of certain pages, using dynamic component template inserts.

To get around the load problem, I want to use an approach where we store all the offers in a component, then get that component by ID at run time, and iterate through the offers in it, checking whether each one is applicable given the URL variable.

The problem is I've not found a way to get a component by id as a data object, and interogate it. I need to be able to get the list of ids from the collection, and then get the various fields from those components.

How would you do this? I can't find any documentation for it. Apologies if this is simple, I'm under quite a lot of pressure and don't have a lot of experience with Tridion.

We're using ASP Java in Tridion 2011 SP1

Thanks

0

Welcome to the wonderful world of Tridion. The content of a Component Presentation is determined by the template used in Tridion CM. In more "traditional" implementations you will find that the content of a component is actually an HTML representation of the content, which doesn't really fit your needs.

Modern solutions with Tridion, like DD4T or the DXA, use component templates that push this content as a structured data format (XML or JSON, depending on the version) which does fit your needs. Adopting those frameworks for your implementation would be time-prohibitive, given the sense of urgency I get from your message, but you could follow a similar approach.

  1. Define a schema in CM where the content you need can be stored.
  2. Create a Component Template (associated with that schema) that can publish the content either as is (XML) or transform it to JSON (here's a good example of such a template). Mark this template as dynamic, so that components can be published by themselves, without a page container.
  3. Load the component presentation in your web application, deserialize it, do your thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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