addHtmlAttribute(scope, attributeName, attributeValue)
Adds a html attribute for element. copy theme.addHtmlAttribute("html", "direction", "rtl");
addHtmlClass(scope, className)
Adds html class for element. copy theme.addHtmlClass("body", "app-default");
printHtmlAttributes(scope)
Returns all scope attributes separated by the space. copy <html <%= theme.printHtmlAttributes('html') %>>
printHtmlClasses(scope)
Returns all scope classes separated by the space. copy <body class='<%= theme.printHtmlClasses('body') %>'>
getIcon(path, classNames)
Returns content of svg icon wrapped with
. copy <%- theme.getIcon("duotune/general/gen032.svg", "svg-icon fs-1" ) %>
setModeSwitch(flag)
Sets mode switch value for current class instance. copy theme.setModeSwitch(false);
isModeSwitchEnabled()
Returns modeSwitchEnabled value. copy <%if (theme.isModeSwitchEnabled()) { %>
setModeDefault(mode)
Sets default mode value for current class instance. copy theme.setModeDefault(false);
getModeDefault()
Returns default theme mode. copy <%= theme.getModeDefault() %>
setDirection(direction)
Sets theme style direction RTL
or LTR
. copy theme.setDirection(false);
getDirection()
Returns current class instance direction value.
isRtlDirection()
Checks if style direction is RTL.
getAssetPath(path)
Converts relative asset path to absolute path. copy <img alt="Logo" src="<%= theme.getAssetPath(`media/logos/custom-1.png`) %>" class="h-60px h-lg-75px"/>
extendCssFilename(path)
Verifies style mode and if it is rtl returns rtl exteted style file name. copy theme.extendCssFilename("css/style.bundle.css")
getFavicon()
Returns full path favicon from configuration. copy <link rel="shortcut icon" href="<%= theme.getFavicon() %>" />
getFonts()
Returns fonts array from configuration. copy <% theme.getFonts().forEach(function(font){ %>
<link rel="stylesheet" href="<%= font %>" />
<% }); %>
getGlobalAssets(type)
Returns theme global js or css files array defined in theme configuration. copy <!--begin::Global Stylesheets(mandatory)-->
<% theme.getGlobalAssets("css").forEach(function(file){ %>
<link rel="stylesheet" type="text/css" href="<%= file %>" />
<% }); %>
<!--end::Global Stylesheets-->
addVendors(vendors)
Adds multiple new vendors to view. copy theme.addVendors(['amcharts', 'amcharts-maps', 'amcharts-stock']);
addVendor(vendor)
Adds single vendor to view. copy theme.addVendor("datatables");
addJavascriptFile(file)
Adds custom CSS file to view. copy theme.addJavascriptFile("js/widgets.bundle.js");
addCssFile(file)
Adds custom JS file to view. copy theme.addJavascriptFile("css/style.bundle.css")
getJavascriptFiles()
Returns array of all custom js files. copy <% theme.getJavascriptFiles().forEach(function(file){ %>
<script src="<%= theme.getAssetPath(file) %>"></script>
<% }); %>
getCssFiles()
Returns array of all custom css files. copy <% theme.getCssFiles().forEach(function(file){ %>
<link rel="stylesheet" type="text/css" href="<%= theme.getAssetPath(file) %>" />
<% }); %>
getVendors(type)
Returns array of vendor files. copy <% theme.getVendors("css").forEach(function(file){ %>
<link rel="stylesheet" type="text/css" href="<%= file %>" />
<% }); %>
getAttributeValue(scope, attributeName)
Returns element attribtue value. copy theme.getAttributeValue("body", "data-kt-app-layout")=="dark-header")
getPartialPath(path)
Converts a relative partial path to absolute. copy <%- include(theme.getPartialPath("partials/theme-mode/_init.ejs")); %>
getLayoutPath(path)
Converts a relative layout partial path to absolute. copy theme.getLayoutPath("systen")
getPageViewPath(folder, file)
Helper function to get page view by page folder and file name. copy theme.getPageViewPath("auth", "new-password")