2

I'm implementing DD4T.

On many WEB site, there are contents on right or left column, like "banners" or "links to related content". I'm wondering how to handle those kind of content.

Generally lots of pages have same side column contents, so if it's a static component presentation on page, user have to add same component to lots of pages. But because not "all" pages have same contents even if the pages are using same page template, it's difficult to display them automatically.

For instance, a electric product company's WEB site have products pages. There are product categories, "TV" and "PC".

  • "TV" category has 100 pages, and those 100 pages have same banners.
  • "PC" category has 100 pages, and those 100 pages have same banners, but the banner is different from "TV" category's.

Using structure group's metadata is one of good solutions on compound template(Set a component to structure group's metadata, then all pages in the structure group use the component). But DD4T cannot retrieve structure group's metadata.

I think it's possible publishing structure group's metadata as XML by TBB, then DD4T get metadata from the XML. But I'm afraid that performance is bad on both of TBB and DD4T.

what's good solution?

1

You can use categories and keywords for classifying different types of content like pages of different products in your example.

So, in your example the department/electronics will be the category and TV, PC etc will be keywords. On the keywords classify the banner components like PC keyword will have PC banner component classified on the keyword.

On save of a page in a certain structure group like "PC", automatically classify the appropriate keyword using the event system to the newly created page.

Create the banner components as a dynamic components so that you don't have to publish the pages everytime, when you change banner images in the banner components.

Now, from DD4T you will be able to get the classified keyword on each page which will have the TCM uri of the banner component. You can query for the same using TCM uri and render the same in any page by calling render dynamic component method from DD4T. This logic of getting and including the dynamic component will be on your page template (which can be c# razor view or its equivalent in Java)

| improve this answer | |
  • Thanks for answer, but it's not what I want to ask(my question didn't contain enough information). So I edited my question. Also, I found following post tridion.stackexchange.com/questions/11043/…. A default TBB get structure group's metadata, this can be a solution. – Hirokazu Shikata Jun 19 '15 at 0:12
  • Updated answer as per additional details in your question – Vipin Kothari Jun 19 '15 at 1:10
1

You can use InheritMetadataComponent or InheritMetadataPage template, which inherits page level metadata and you can read the parent meta data in your view

| improve this answer | |

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.