If you only want the UI hint to affect the editor and not both the editor and template, you need to speficy this in your UIHint:
[UIHint("something", presentationLayer: PresentationLayer.Edit)]
The issue is that the visitor can't see the changes. It's just empty.
Seems to be an issue with the iteration of the data.
@foreach (var linkItem in Model ?? Enumerable.Empty
hello always shows up
Is it not just that the misspelling in the sample UIHint that you posted above is causing this?
That didn't resolve the issue, just a mistake a made when pasting the code.
Have you checked in debugger that you have your layoutmodel set and you have any items there when it is passed to template for LinkItemCollection?
We see that you have code to create the layoutmodel but do you actually ever set it for the implementation of your IPageViewModel?
So I would check the code that creates the viewmodel and sets the layoutmodel for it and have breakpoints in code to see that the value is set and if set at what point the linkitemcollection gets "nulled" if that is the case.
I am trying to add a LinkItemCollection in the footer-section of the page. The startpage has a LinkItemCollection that is called "LinkPages". Using edit-hints to connect it for the editors. When viewing the page, the links refuses to come up. Clicking on edit, or adding a new links makes them appear. Saving and viewing the page again and the items will not show up. The links are saved on the startpage LinkItemCollection but will not display.