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?
I was exploring the KTTheme Service to implement a sticky header on my client's plumbers in chula vista ca project, and I came across the API documentation. The guide mentions using KTTheme.AddHtmlClass("body", "header-fixed") for this purpose. However, I was stuck on where to inject and call this service. After digging a bit, I found it works best if you inject this in your page’s initialization script, right after the page is loaded or the DOM is ready. It ensures the sticky header is applied seamlessly.
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"");