-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: "Customize Admin Branding" code sample is unclear #16198
Comments
Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. A core team member will review your issue and get back to you. If you like Orchard Core, please star our repo and join our community channels. |
You shouldn't really need to do that. The default shape template does the same as the code sample in the docs. Probably you need this line in your theme's
|
OK. Nice thanks for the heads-up, I was there was something I was missing. Although if I put that in _ViewImports.cshtml then every other Razor Page in my project backed by a model will throw an error. If I put it in just the _Layout.cshtml instead, then it appears to work without issue. Either way, it would be helpful to have the above advice in the documentation page I highlighted. |
Sorry, I'm confused about what exactly you're doing. Can you share the code? Because I don't understand how you're using Razor Pages. Or by "Razor Page" do you mean a Razor view template? Do you have a custom Admin theme as explained here? You shouldn't need a _Layout file there, and that's definitely not the recommended approach. |
All I am trying to point out is that the code sample presented in the documentation page is missing the details on how to get a reference to the Symbol @Site.Sitename. I think you could clarifiy this by adding one or two lines of extra code to the sample...(razor example) to make it obvious where the @Site symbol is coming from...
[rest of Code Sample] |
OK, thanks for explaining. Though neither should really be needed:
So I'm just confused about what exactly are you doing and thus unclear about which part of the documentation needs to be updated. |
It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply. |
Closing this issue because it didn't receive further feedback from the author for very long. If you think this is still relevant, feel free to reopen it with the requested details. |
DocLink: https://docs.orchardcore.net/en/latest/reference/modules/Admin/
Section: Customize Admin branding, code sample.
Code Sample includes the use of @Site.SiteName but does not give reference on how to access the symbol "@Site". I was able to work it out by digging through past issues and code but, there goes another 30 minutes of my life ;-)
Expected behavior
One way I found (perhaps there is a better way?) was just add these lines to the view...
`@inject OrchardCore.Settings.ISiteService SiteService
@{
var Site = await SiteService.GetSiteSettingsAsync();
}
`
These lines added to the Code sample might save future explorers some time.
Screenshots
The text was updated successfully, but these errors were encountered: