Comments (6)
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.
from orchardcore.
You shouldn't really need to do that. The default shape template does the same as the code sample in the docs. Site
is a property on the view and thus available by default.
Probably you need this line in your theme's _ViewImports.cshtml
(see the built-in one)?
@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>
from orchardcore.
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.
from orchardcore.
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.
from orchardcore.
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...
@* ...In a custom Admin theme: Site variable is automatically available using... *@
@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>
@* ...from a random layout or view...inject the SiteService...*@
@inject OrchardCore.Settings.ISiteService SiteService
@{ var Site = await SiteService.GetSiteSettingsAsync(); }
[rest of Code Sample]
from orchardcore.
OK, thanks for explaining. Though neither should really be needed:
- If you're in an (admin) theme, then this
inherits
is already implied (at least if you generated the theme with the OC codegen templates or followed the docs). So theSite
property should be available. - In other cases, while indeed you need to resolve
ISiteService
to access the site settings, that's not about customizing the admin branding anymore. For that, you need an admin theme.
So I'm just confused about what exactly are you doing and thus unclear about which part of the documentation needs to be updated.
from orchardcore.
Related Issues (20)
- ConcurrencyException raised by ContentDefinitionManager HOT 10
- Infinite recursion when Content Picker Field references its own parent item with displaying shape override HOT 2
- `JsonDynamicValue' does not contain a definition for 'ToObject' HOT 7
- About enabling features in the setup recipe HOT 3
- Sanitization is causing some shortcodes to not render correctly in the MarkdownBody HOT 13
- Recipes Improvements HOT 19
- Add ExposedHeaders in CORS module HOT 5
- razor view does allow dynamic casting of property values using system.text.json HOT 21
- [LinkField] Add option to select the Target - _blank, _self, _parent and _top HOT 7
- Migration type identification error HOT 9
- Generalize options editor HOT 4
- LinkGenerator does not take in consederation the site prefix HOT 4
- OrchardCore_Media__AssetsPaths says it supports absolute paths but doesn't HOT 2
- Notification editor doesn't close when saving a draft HOT 13
- Saving workflow fails when using decimal comma (,) HOT 7
- Solution load fails
- OrchardCoreCmsWeb Only runs one time, second run giving page not found error HOT 11
- Getting value from JsonDynamicValue in Jint HOT 7
- ShellScope RegisterBeforeDispose should support sequential inserts HOT 3
- Rebuilding elastic index takes a lot of time HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orchardcore.