6

I have a bit problem and a few new questions related with the rich text.

When I create a new component, linked another component in a rich text field of the first component, create a page and add the first component to that page, and publish the page then the linked component is not published in the broker.

I want when I publish the page all linked components to be published - all components which are in the scope of the link level field of the component/page templates.

Maybe I missed to add a needed building block in my component template?

Or this issue is solved in the last version of DD4T?

Or there is another way to solve this problem?

Thanks in advance.

2 Answers 2

9

There are two basic patterns: either you publish the linked component inside of the page ("embedded scenario") or you publish them seperately as dynamic components ("DCP scenario").

In the embedded scenario, the linklevels allow you to specify how many levels of linked components are included. In the end result, the linked components are available directly through the DD4T api.

In the DCP scenario, you should write a custom resolver to include your linked components in the publishing. In the end result, the linked component will be partially there (no content or metadata available), and you'll have to use the componentFactory to retrieve them dynamically.

Hope this helps :)

3
  • This is like the embedded scenario - but Boris wants to process Component Links inside the RTF field in the same way that Component Link fields are processed. Any idea if we can re-use the Component Link functionality for Component URIs inside an RTF?
    – robrtc
    Jun 5, 2013 at 11:39
  • 1
    One of the great things about DD4T is that you can influence your API with a simple TBB. You could write a TBB that looks at all the componentlinks inside rich text fields, and add these as component metadata in a "resolverRichTextFieldLinks" fake component link field. Just use the DD4T builders to build the stuff for you! You can then retrieve the full component links (including potential linklevels) from your content delivery side DD4T api. Jun 6, 2013 at 7:21
  • Thanks Rogier - very simple and creative solution to this challenge. :)
    – robrtc
    Jun 6, 2013 at 7:40
5

This doesn't sound like a DD4T issue and I don't think that's how Component Linking is supposed to work.

As I understand it, the Link Level field is for adding data from Component Link fields into the published Xml for use in your CTs and PTs. Adding a Component Link to a Rich Text field is not the same thing.

In that scenario you are indicating that for the linked text a dynamic hyperlink should be created to Component B from Component A at request time wherever Component B is currently Published with the highest priority CT. It is the editor's responsibility to ensure that Component B is published.

If Component B was dynamically published when Component A was published on a page, what would the Dynamic link be? Component B would have no url as such.

So basically I think you need to clarify what you are trying to achieve with this linked component.

1
  • I think this is not a good solution or I do not understand the idea. For example, you could have a lot of pages, each page has a component(LevelA) with a reach text field, and in each field you could have text and attached link to other component(LevelB). So, if the publishing is not added automatically the component of LevelB in the broker, then maybe the same component won't be unpublished automatically if you unpublish the page. Then, the editors have to check each rich text for link to other component, to check whether the linked component is used somewhere else and then to unpublish it.
    – Boris T.
    Jun 4, 2013 at 8:13

Your Answer

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

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