Starts in:
1 DAY
14 HRS
52 MIN
30 SEC
Starts in:
1 D
14 H
52 M
30 S
Open Closed

Override Lepton Theme #2047


User avatar
0
maristides created
  • ABP Framework version: v4.4.3
  • UI type: Blazor Server
  • DB provider: EF Core

Hi,

We have developed software in the past using Syncfusion controls. This is the first time we will use Abp Framework + Commercial modules. Commercial templates come with Lepton theme pre-installed. We would like to maintain Lepton theme management and they way menu items are generated. However, we want to ovewrite the existing controls (blazorize) with Syncfusion controls. So for example the main menu (left side) to show the items in the same way as it already does but instead of using a sidebar control from blazorize to use a sidebar control from Syncfusion. I have read the articles and documentation of how you can add lepton theme module inside your solution and change the reference from nuget to module. However, nothing changes on the ui regardless the override of files. Can you provide some steps or a sample project that shows the best way to achieve the above?

Thanks


9 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi maristides

    You can replace Lepton theme package with source code via using ABP Suite:

    https://support.abp.io/QA/Questions/462/How-can-I-download-Lepton-Theme-source-code#answer-443079cf-43ba-d676-cd46-39f7f66bc2fd

    Then you can customize any part of the theme.

  • User Avatar
    0
    maristides created

    Hi enisn,

    Thanks for your response. I already know about this. I have tried it as well. The problem is that when i try to overwrite a control nothing changes. It seems that theme can't be overwritten. Can you please provide an example of how main menu control could be replaced with something else?

  • User Avatar
    0
    alper created
    Support Team Director

    if you replaced the source-code then you can change it in your custom Lepton project. isn't that working?

  • User Avatar
    0
    maristides created

    No,

    For example i navigate to modules\Volo.LeptonTheme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\Themes\Lepton\Components\MainMenu\Default.cshtml and i comment out the entire sidebar @<div class="lp-sidebar collapse navbar-collapse d-lg-block" id="navbarSidebar"> <div class="lp-sidebar-header"> <div class="lp-toggle-sidebar"> <i class="fa fa-align-left material-icons lp-open-icon"></i> <i class="fa fa-align-justify material-icons lp-close-icon"></i> </div> </div> <div class="lp-sidebar-wrapper"> <nav role="navigation" class="lp-sidebar-navi"> <ul> @foreach (var menuItem in Model.Items) { @await Html.PartialAsync("~/Themes/Lepton/Components/MainMenu/_MenuItem.cshtml", menuItem) } </ul> </nav> </div> </div>@

    but when i run the project it still shows the main menu. Do i miss something?

  • User Avatar
    0
    maristides created

    Hi,

    As we speak i have also tried the following:

    1. Created a new solution with the free Template and Basic Theme
    2. Added all the commercial modules manually
    3. Added the source code of the Basic Theme in my solution
    4. Updated the project references

    I still can't overwrite the theme. I comment out entire section and they still appear on screen. Is it possible to send you my solution for you to test?

  • User Avatar
    0
    maristides created

    Hi guys,

    I have found a solution to the above. I have:

    1. Created a commercial solution
    2. Replaced the lepton theme with the basic theme
    3. Added the basic source code to my solution
    4. Updated the references

    Now i can override the theme but i have another problem. As i said in the beginning i want to work with Syncfusion controls. I added the controls in the Blazor project as mentioned on the docs. However, the UI now is managed from the module and not Blazor project. How can i inject Syncfusion to the module as well?

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Are you sure Lepton Theme is built after your changes. Can you check last change dates of lepton dll's?

  • User Avatar
    0
    maristides created

    Hi,

    I finally got it working. The structure is a bit confusing. When i created my project using ABP Suite i chose Blazor Server as the UI and i was expecting to have one UI project (only Blazor). Importing the Lepton theme source code, I realised that there are 3 UI projects involved.

    1. Volo.Abp.AspNetCore.Components.Server.LeptonTheme
    2. Volo.Abp.AspNetCore.Components.Web.LeptonTheme
    3. Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton

    Is there a plan to change the structure for Blazor and provide a single UI project without having any MVC parts involved?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @maristides, Blazor Server template uses pages/components from both MVC and Blazor WASM. Therefore, it indirectly depends on both Volo.Abp.AspNetCore.Components.Web.LeptonTheme and Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton.

    Is there a plan to change the structure for Blazor and provide a single UI project without having any MVC parts involved?

    Currently, we don't plan to such a seperation.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06