are there any limitations with embedded razor templates. The issue:


And child Level 1 has


And child Level2 has


And Level3 has


So the final output should be:


but currently, I am seeing output as Level0 only. Is this expected?

2 Answers 2


When a template is compiled by the razor mediator, any embedded templates are resolved and the text is embedded before compilation occurs. The resulting assembly is cached, and that's the last time the embedded templates will be looked at until the embedding template is for whatever reason compiled again.

The trick is to make a small, otherwise irrelevant change in the embedding template. For example, change the title. (I usually change it back immediately - the point is to update the timestamp of the last save.) This will ensure that the cached version is now out of date, and the whole process of resolving embedded templates will happen again.

The other way to clear the cache is to restart the publisher service. I'd usually recommend that in development, the quickest/easiest way is the first method, while in production, your best bet is to restart the publisher after the content porter import.

  • Thank you Dominic, i did try restarting the service (actually i restarted all inlcuding COM+ as its a dev env) but no luck. But this is a valuable info. Thank you
    – Harish A
    Commented Aug 23, 2016 at 13:33
  • Oh well... it was worth a try. I'd suggest downloading the sources of the razor mediator and examining the logic. You could even make a debug build and step through what's happening. Commented Aug 24, 2016 at 8:59

It seems to be the issue with TBB that are generating output to placed in broker DB.

If you are using DD4T TBB for publishing then there is parameter LinkLevel, which identifies how much deep it should traverse through to render the output.

The default value of LinkLevel is 1.

Looking at the output, it seems that you have not specified the LinkLevel parameter.

Given below is the syntax for adding LinkLevel parameter

    <Template xlink:href="tcm:x-xxxx-2048" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="Title" />
      <Parameters xmlns="DD4T.Templates.Schemas.DynamicDeliveryParameters">

Here, I have given LinkLevel as 6 that means it will go down until 6 levels.

  • Thank you Hiren, though we are not using DD4T as of now, this actually makes a complete sense. I will start looking in this direction. Again, thanks for the valuable pointer. Will mark the answer as soon as i get that working, if its ok.
    – Harish A
    Commented Aug 22, 2016 at 18:13
  • That's fine, let us know your finding on this. I ll be interested to know what is causing this behavior in non-dd4t implementation.
    – Hiren Kaku
    Commented Aug 22, 2016 at 18:15
  • @HarishA - The first place where you should look is odata output, if it contains all the levels. If it doesn't contain then TBB is the problem where you are not retrieving components recursively during rendering.
    – Hiren Kaku
    Commented Aug 22, 2016 at 18:17

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.