0

I am adding a statically bound rendering inside of a view like this:

@Html.Sitecore().Rendering("myControllerRenderingId", new { DataSource = "myDatasourceId" })

This is working fine and the rendering is displaying properly on the page. However, it doesn't appear that I can select and edit the rendering in Experience Editor like I can on other renderings added through presentation details in Sitecore. (I can edit the text fields within the rendering, but I can't select the rendering itself.) Is this expected behavior?

Thank you!

  • Is it rendered in a placeholder? – Mark Cassidy Mar 19 at 16:20
  • That makes sense. If you statically render a component, there is no entry for that in the presentation details on the page. So you wouldn't be able to edit any of the component properties. – Richard Seal Mar 19 at 16:23
  • @MarkCassidy - it is not explicitly rendered in a placeholder. I was wondering about this and tried to specify a placeholder name but it doesn't appear you can do this. – John Frederick Mar 19 at 16:36
  • AFAIK you can't statically bind a rendering into a placeholder – Richard Seal Mar 19 at 18:23
0

This is precisely what "static" part in "Static Rendering" stands for.

"Static" is the opposite of "dynamic". Dynamic is something what can change, static is just static.

Yes, it's expected behavior.

You cannot select the rendering in Experience Editor. Why? Cause there is nothing you can do with it anyway. You cannot edit its datasource as it's hardcoded in your cshtml file, you cannot add personalization or mvc tests, as it is not a part of your presentation details. It's hardcoded, you cannot change anything there.

Well, you can change the fields of the datasource, as you wrote in your question. And that's because none of them is hardcoded in the view. But as your datasource id is hardcoded, you will be modifying that datasource item fields always.

| 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.