This theme template is made especially for passionate designers who wish to create awesome looking solutions using Oqtane.
- Create a folder like
C:\projects\2shine-oqtane\
- In that, git-clone the following repos
- Prepare NPM - run
npm ci
in the folderoqtane-theme-2shine-bs5/Client
- Run Rename script
- Also rename the theme in the
ThemeInfo.cs
- Open Visual Studio with the solution in the project oqtane-theme-2shine-bs5
- Run once (make sure Oqtane-server is the primary project) - get it setup etc.
- Then build and run as you need
- For js/webpack ATM it's easiert to also open the
cre8magic/oqtane-cre8magic.code-workspace
in vs code- the code is then in the
oqtane-theme-2shine-bs5/Client/src
- the code is then in the
It has a bunch of magic baked into it, allowing for fast iterative design. Here's what makes it special:
- Everything is Bootstrap 5 Best-Practices and most of the work is done with SASS, Webpack and Typescript
- This means 95% of all design work can be done without recompiling the theme or restarting Oqtane
- You can do all the work using VS Code (and without the heavy Visual Studio)
- You can live-develop a theme and auto-deploy the builds to an Oqtane in your network - without restart
- Almost all the logic is well hidden in a separate layer, staying out of your way.
Why is this important?
- Normal Oqtane Themes require you to recompile and restart Oqtane after every change.
This is very tiresome when you are tweaking the design step-by-step. - Normal Oqtane Themes have a lot of logic and HTML mixed together the Razor files.
This makes it difficult and scary for designers. It also makes it hard to update to an improved logic-stack without extensive manual work. - Normal Oqtane Themes require a lot of code to get the Menus right.
This is error-prone and most designers will never get it right.
- A Bootstrap5 best practices setup
- Build-and-deploy automation
- Ca. 20 lightweight Razor components
- Ca. 5 prepared layouts (full-width, centered, etc.)
- MagicMenu Engine
- MagicClasses (TODO:)
- MagicConfiguration
- ...
👉🏾 Read more in What's Inside the Package
This setup is meant to make you super efficient and productive. But to benefit from them, you need to understand how all the parts tie together.
-
Installation, Build, Deploy
-
Configure a Theme and Styling in JSON
-
Get the Most out of Bootstrap5 with SASS
-
MagicClasses & MagicContext
-
MagicMenu
-
MagicSettings (todo, incl. passing around etc.)
-
MagicLanguages
- Oqtane is still missing the DNN concept of each page having a specific language. That means the 2shine language classes and the page-root-neutral class are still missing. Those will be added as soon as Oqtane implments that feature.
You can either manage the navigation configurations with the parameters that you can give to the razor control NavEntry or you can give them to the navigation.json file, which is located in the src folder.
If you want the configurations from the config file to be used you just have to write the Key from the "NavConfigs" array which you want to use in the ConfigName parameter. The parameters defined with the razor control have priority and will override anything defined in the config file. So if you want to use the config file it is best to only define the ConfigName in the Blazor Component.
These three parameters define the starting point for the navigation and you should only use one at a time the other two should just not be defined:
-
StartingPage:
This parameter expects a string.
You can either give a "*" to start from the root level or you can give a pageId to start from that specific page (Tip: To start with the children of a specific page put the pageId here and set the LevelSkip parameter to 1). -
StartLevel:
This parameter expects an integer.
This parameter expects a specific Level and will display anything on that level -
PageList:
This parameter expects a List if integers.
You can put pageId's in the list and the pages will be displayed
These parameters are used to define more settings:
-
ConfigName: This parameter expects a string.
Makes the link between a certain control and the defined settings in the config file. -
LevelDepth:
This parameter expects an integer.
Is used to define how many levels the navigation should go down in the page tree from the defined starting point. The value 0 means that only the starting point will be displayed 1 means the children of the starting point will also be in the navigation. -
LevelSkip (optional):
This parameter expects an integer (Default: 0).
Skips the defined number of levels if given 0 wont skip anything if given 1 skips one level -
Display (optional):
This parameter expects a boolean (Default: true).
Deactivates the generation of HTML for this navigation -
Variation (optional):
This parameter expects a string (Default: "Main").
Choosing between the different layout options defined in Menu/NavEntry.razor.
The LanguageChanger control can be used to display Links to switch between different Languages change the names with are used to display these Links. This is done with the Languages Parameter.
- Languages:
This parameter expects a string.
This parameter manages the display names of the languages. To change the display name of english which has the language code "en" you will need to write "en: yourName". To change the names of multiple languages you can write "en: yourName, nl-NL: yourName".
- Many of our controls have an obvious name like
Menu
but it can be confused with theOqtane.Theme.Controls.Menu
. Since we rarely use the default Oqtane controls, we don't recommend having it in your_imports.razor
but instead we reference them explicitly where we need them.
See also folder and namespace docs
- Rename
Cre8Magic
toCre8Magic
- namespace
- base classes, services, etc.
Magic...
- Feature to add
Custom
settings to a layout config - just a dictionary of objects?
- Must verify packaging etc. works
- Reconsider including the dist-folder, and maybe renaming it to wwwroot???
- Resources / multi-language of various parts
- Breadcrumb revealer doesn't work as expected, only hides "Home"
- Styling of footer menu to be "something | something | something"
- Nav features
- ability to exclude pages (especially on home level)
- verify that we need
toshine-mainnav-variations-...
classes - In general, probably rename
to-shine-...
classes totoshine-...
- update bootstrap to 5.2
- ideally try to move out the js for the page to the project Cre8Magic
- find a way to allow layouts/designs/logos etc. to vary by site-id
- more configurable settings on layout, like breadcrumb on/off etc.
- Version 1.0.0 created ca. July 2022 but still WIP
- Version 2.0.0 with major updates (docs not in sync yet) August 2022
I hope u enjoy it ;-)