npm.io
2.0.0 • Published 1 year ago

aitomic-m-lang

Licence
SEE LICENSE IN license.txt
Version
2.0.0
Deps
1
Size
10 kB
Vulns
0
Weekly
0

A template of language switcher. Import {latte} block in '@layout.default.latte' using macro {import '../path-to-latte-template'} and declare this block as {include #m-lang}. Between macros {import} and {include} redefine template of used blocks like this:

{block #itemName}
	<span class="m-lang__name">{$mutation->name}</span>
{/block}

{block #control}
	<label for="language-status" class="m-lang__link m-lang__control">
		{include #itemName, mutation => $lang}
	</label>
{/block}

Take a look at source of {latte} template to discover available hooks to customization.

Optionally set variables for CSS classes of list, item and link:

{include #m-lang, componentClass => '', itemClass => '', linkClass => ''}