Skip to main content

Functions & Settings

This page lists the functions and setting keys usable for themes.

Functions

FunctionDescription
{{ auth()->check() }}Checks if the user is logged in
{{ auth()->user() }}Returns the logged-in user
{!! app('seo')->head() !!}Returns the metadata to add in the head
{!! app('seo')->favicon() !!}Returns the meta tag for the favicon
{!! app('seo')->foot() !!}Returns the end-of-page scripts
{{ setting(key, value) }}Returns the value of a configuration setting
{{ basket(false) }}Returns the basket model
{{ basket()->total() }}Returns the basket total
{{ basket()->quantity() }}Returns the number of items in the basket
{{ basket()->items() }}Returns the basket items
{{ is_darkmode() }}Returns true if the page is in dark mode
{{ is_lightmode() }}Returns true if the page is in light mode
{{ format_bytes($bytes, $precision = 2, $suffix = true) }}Returns the formatted byte size (KB, MB, GB, etc.)
{{ currency() }}Returns the current currency in ISO format
{{ currency_symbol(?$currency = null) }}Returns the current currency symbol
{{ currencies() }}Returns an array containing all currencies
{{ tax_percent(?$iso = null) }}Returns the tax percentage for a country
{{ formatted_price($price, $currency = null) }}Returns the formatted price with currency
module_path($module, $path)Returns the path of a file in a module
addon_path($module, $path)Returns the path of a file in an addon
theme_manager()Returns the theme manager instance
{{ is_subroute($route) }}Returns true if the route is a sub-route
{{ is_route($route) }}Returns true if the route is the current route
{{ ctx_version() }}Returns the CLIENTXCMS version
{{ theme_config($key, $default = null) }}Returns the theme configuration
{{ translated_setting($key, $default = null) }}Returns a translatable setting value from the database

Settings

You can retrieve them with the {{ setting() }} function.

KeyDescription
app_nameSite name
app_urlSite URL
app_timezoneSite timezone
app_addressSite address
app_logoSite logo
app_logo_textSite text logo
app_faviconSite favicon
app_debugSite debug mode
app_envSite environment
theme_header_logoDisplay logo in site header
theme_switch_modeTheme type (both, light, dark)
theme_footer_descriptionFooter description
theme_home_title_metaHomepage meta title
theme_home_image_metaHomepage meta image
seo_site_titleSite title (displayed next to page title)

You can retrieve them with the {{ setting() }} function or {{ translated_setting() }}.