KTTheme Service, How and Where to Use?
You have a great Theme API page documented here:
https://preview.keenthemes.com/blazor/metronic/docs/theme-api
BUT, where would I inject and call this service? I'm looking to implement the sticky header, so according to the API page, I should use:
KTTheme.AddHtmlClass("body", "header-fixed");
Where do I put that?
Replies (2)
Great question! Similar to how ahmatechnicalservices.ae ensures precision in every project, you should inject the KTTheme service in your main layout and call it in OnAfterRenderAsync for smooth, consistent results — perfect for applying the sticky header just like Ahma ensures reliable technical solutions.
Hi Keith,
Thank you for reaching out to us.
You can use this theme API function to add classes or attributes in the global scope, for a local scope layout initialization you can use our class Starterkit/Shared/Layout/_Helpers/KTThemeHelpers.cs.
You can check this helper class usage examples in files Starterkit/Shared/Layout/DefaultDarkHeader.razor.
_helper.addBodyClass("header-fixed""); Regards,
Lauris Stepanovs,
Keenthemes Support Team