Overuse of Content keyword is often confusing. #14240
Replies: 4 comments 2 replies
-
IMO,
Thing to remember ContentItem.Content is json |
Beta Was this translation helpful? Give feedback.
-
I see your points, and some of these I personally got confused about before too... Could you open a PR with some renames you find the most important? I can work with you to introduce them in a non-breaking way. Then, you can better present these to the community for feedback. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
We can keep old props around, just mark the obsolete. I'll make a PR when i get some time. |
Beta Was this translation helpful? Give feedback.
-
One thing i find a bit disorienting in orchard is how often the word Content is used for all sorts of things, and often for stuff that really is unrelated.
For example, in a view i would often use:
Model.Content - this Content here is not actually the content, it's a zone (like Header and Footer). This should have been Model.Main
Then on some other part of the view i would see ContentItem.Content - this content is a dynamic which returns json values. This should have been named ContentItem.Value or ContetItem.Record of ContetItem.JObject. You can easily see both of these contents in the same file and they would present completely different things.
There's a couple of other things which give me headaches, like ContentManager.Update(contentItem) not actually updating the database but the underlying json, so that name is also misleading, but i've learned to live with those (eg. wrap them)
I think these naming changes would be a great help for eliminating confusion, especially when you're working inside liquid.
And they could also be done with fall back to previous naming.
Beta Was this translation helpful? Give feedback.
All reactions