Closed dzordzs closed 3 years ago
I think this only worked sort of, in v7 because of dynamics
If you want to render the standard fields, these are available on the model as strongly typed properties. I don't think we want to take a step backwards to have non-strongly typed results with magic strings?
@Model.Name
@Model.Level
@Model.CreateDate
Strongly typed does work indeed but then I guess we would need to change the output of what Umbraco serves. If you do use the helper then it should automagically output @Model.Name
instead of @Model.Value("pageName")
.
Just a quick note - with this syntax, there is no 'helper' :) this is just @Model
is just IPublishedContent
, we're just dealing with a model here.
we would need to change the output of what Umbraco serves
What are you referring to here @dzordzs ? The query builder or something? If umbraco is generating this syntax somehow then that's the issue, not the other way around
It's the one you can use in the template @Shazwazza Insert -> Value:
ok, that's the bug then, i'll update the title
@Shazwazza I've just been investigating this - as far as I can see, it's not the Query Builder that is outputting incorrect markup, it's the Insert -> Value modal.
It should be a fairly simple fix to output e.g. @Model.Name
for standard fields, however there is an extra challenge. Should you still be able add a default value or set a standard field to recursive? These settings rely on @Model.Value()
extensions, so I think you would have to come up with a different approach to get these working for standard fields.
I'm working on a PR on this issue.
Still an issue... just test on latest stable v8, all standard settings (so models builders purelive) and the value dialog recommends @Model.Value("createDate")...if you insert that nothing happens... so ideally the insert value dialog should check the modelsbuilder setting and suggest the correct working syntax... since I imagine that for new users that just wanna take a quick spin this is confusing...
Alos would be ace, if someone with the correct permissions changes this issue to "Insert Value Dialog" instead of "Query Builder"
Would be nice if @warrenbuckley's work can be used for this https://twitter.com/warrenbuckley/status/1228292889161195520 since the base seems to be there...
Hiya @dzordzs,
Just wanted to let you know that we noticed that this issue got a bit stale and might not be relevant any more.
We will close this issue for now but we're happy to open it up again if you think it's still relevant (for example: it's a feature request that's not yet implemented, or it's a bug that's not yet been fixed).
To open it this issue up again, you can write @umbrabot still relevant
in a new comment as the first line. It would be super helpful for us if on the next line you could let us know why you think it's still relevant.
For example:
@umbrabot still relevant This bug can still be reproduced in version
x.y.z
This will reopen the issue in the next few hours.
Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:
Updated Report
The issue here is that the Query builder is not outputting the correct values for 'built in' properties like 'pageName' (which is just Model.Name) see https://github.com/umbraco/Umbraco-CMS/issues/5437#issuecomment-490871090
Same issue goes for other built in values like created date, etc...
Original Report
Rendering standard fields using Umbraco Helper does not work.
Steps to reproduce:
@Model.Value("pageName")
for exampleAnd this issue is with all standard field (pageName, CreateDate, level etc) Custom fields are rendered just fine, for example
@Model.Value("companyName")
Expected result
If you are rendering
@Model.Value("pageName")
then you'd expect that Umbraco will return the name of the specific page.