includeFonts()
Function to include fonts HTML.
includeFavicon()
Function to print favicon URL. copy <link rel="shortcut icon" href="{% includeFavicon %}"/>
getIcon(path, classNames = 'svg-icon', folder = 'media/icons/')
Get SVG icon by path. copy {% getIcon 'duotune/arrows/arr079.svg' 'svg-icon fs-2 text-success' %}
printHtmlClasses(scope)
Print HTML classes based on the scope. copy {% printHtmlClasses 'body' %}
printHtmlAttributes(scope)
Print HTML attribute based on the scope. copy {% printHtmlAttributes as 'body' %}
getGlobalAssets(type)
Get global asset files path from the settings. copy {% getGlobalAssets 'css' as assets_css %}
getCustomJs()
Get custom js files from the settings.
getCustomCss()
Get custom css files from the settings. copy {% getCustomCss as css %}
getVendors(type)
Get vendor assets files based on the type, either js or css. copy {% getVendors 'js' as vendors_js %}
isRtlDirection()
Check current text direction based on the settings.
asset(path)
Get asset URL by path. copy <img alt="Logo" src="{% asset 'media/logos/logo-2.svg' %}" class="h-30px" />
addHtmlAttribute(scope, name, value)
Add HTML attributes by scope. copy KTTheme.addHtmlAttribute("body", "data-kt-app-sidebar-fixed", "true")
addHtmlAttributes(scope, attributes)
Add multiple HTML attributes by scope. copy KTTheme.addHtmlAttributes("body", attributes)
addHtmlClass(scope, value)
Add HTML class by scope. copy KTTheme.addHtmlClass("body", "app-default")
printHtmlAttributes(scope)
Print HTML attributes for the HTML template. copy KTTheme.printHtmlAttributes("body")
printHtmlClasses(scope, full = True)
Print HTML classes for the HTML template. copy printHtmlClasses("body", False)
getIcon(path, classNames = 'svg-icon', folder = 'media/icons/')
Get SVG icon content. copy KTTheme.getIcon('duotune/arrows/arr079.svg', 'svg-icon fs-2 text-success')
asset(path)
Get an image path in assets folder by path.
setModeSwitch(Bool flag)
Enable or disable the theme mode switch. copy KTTheme.setModeSwitch(flag)
isModeSwitchEnabled()
Check the theme mode switch status. copy KTTheme.isModeSwitchEnabled()
setModeDefault(String mode)
Set the default theme mode. The supported values are light
, dark
and system
. copy KTTheme.setModeDefault(mode)
getModeDefault()
Get the default theme value.
setDirection(String direction)
Set style direction. copy KTTheme.setDirection(direction)
getDirection()
Get style direction.
isRtlDirection()
Check if style direction is RTL.
extendCssFilename(path)
Extend CSS file name with RTL or dark mode. copy KTTheme.extendCssFilename(path)
includeFavicon()
Include favicon from settings.
includeFonts()
Include the fonts from settings.
getGlobalAssets(type)
Get the global assets. copy KTTheme.getGlobalAssets(type)
addVendors(vendors)
Add multiple vendors to the page by name. Refer to settings.KT_THEME_VENDORS. copy KTTheme.addVendors(vendors)
addVendor(vendor)
Add single vendor to the page by name. Refer to settings.KT_THEME_VENDORS. copy KTTheme.addVendor(vendor)
addJavascriptFile(file)
Add custom javascript file to the page. copy KTTheme.addJavascriptFile(file)
addCssFile(file)
Add custom CSS file to the page.
getVendors(type)
Get vendor files from settings. Refer to settings.KT_THEME_VENDORS.
setLayoutView(view)
Set the current page layout and init the layout bootstrap file. copy KTTheme.setLayoutView(view)