7

How is the resolving of the Component Presentations done with DD4T? We had a strange situation where an older Component Presentation was shown for our Page but using a different CT. Looking into the Component Presentations table of the DB we see that the content was older and using a different CT than our Page.

However, now when it appears to be returning the content correctly.

Is there some caching somewhere built into the framework? We are using all default code.

9

This is actually a problem we dealt with in our current project as well. It seems that when using version 1.25.0 of the DD4T framework there is no way to get a specific ComponentPresentation.

The cause of this problem is that the PageFactory will retrieve the first Component it can find from broker database and this will be cached for future use. So, when the Component is published with multiple templates it might happen to be another one than you'd expect.

Since last week there is an optional parameter (called templateUri) in the ComponentFactory that you can use to retrieve the correct ComponentPresentation for deserialization. To use this version from Nuget, you'll need to use the dd4t-dev package which will contain the latest changes.

| improve this answer | |
  • 3
    Kah is right, but this only applies to pages which have a dynamic CP embedded on them. For static CPs you always get the one that is on the page. – Quirijn Feb 28 '13 at 13:47

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.