Localizator
Language versions and satellites without contexts — auto-translation of resource fields and lexicons, SEO

Outputs resources localized in Localizator. Works with pdoTools snippets (pdoResources, pdoMenu, pdoPage, etc.). Does not work with getImageList.
| Name | Default | Description |
|---|---|---|
| snippet | pdoResources | Snippet name to run |
| class | modResource | Object class |
| localizator_key | current | Localization key |
| localizatorTVs | No | Comma-separated TV names for localized output. If empty, all TVs with “Available in localizations” enabled in TV settings are used; this parameter narrows or overrides the list |
{'Localizator' | snippet : [
'snippet' => 'pdoMenu',
'includeTVs' => 'img',
'processTVs' => 'img',
'parents' => 0,
'level' => 1,
]}[[!Localizator?
&snippet=`pdoMenu`
&includeTVs=`img`
&processTVs=`img`
&parents=`0`
&level=`1`
]]<div id="pdopage">
<div class="rows">
{'!pdoPage' | snippet : [
'element' => 'Localizator',
'parents' => 0,
'ajaxMode' => 'default',
]}
</div>
{'page.nav' | placeholder}
</div><div id="pdopage">
<div class="rows">
[[!pdoPage?
&element=`Localizator`
&parents=`0`
&ajaxMode=`default`
]]
</div>
[[+page.nav]]
</div>{'!mFilter2' | snippet : [
'element' => 'Localizator',
'parents' => 0,
]}[[!mFilter2?
&element=`Localizator`
&parents=`0`
]]{'!mFilter2' | snippet : [
'element' => 'Localizator',
'snippet' => 'msProducts',
'parents' => 0,
]}[[!mFilter2?
&element=`Localizator`
&snippet=`msProducts`
&parents=`0`
]]{set $ids = '!mSearch2' | snippet : [
'returnIds' => 1,
'limit' => 0,
] ?:'99999'}
<div id="pdopage">
<div class="rows">
{'!pdoPage' | snippet : [
'element' => 'Localizator',
'snippet' => 'msProducts',
'parents' => 0,
'ajax' => 1,
'ajaxMode' => 'default',
'sortby' => 'ids',
'sortdir' => 'asc',
'resources' => $ids,
]}
</div>
{'page.nav' | placeholder}
</div>{'pdoResources' | snippet : [
'tpl' => '@INLINE {$pagetitle}',
'class' => 'localizatorContent',
'sortby' => 'id',
'limit' => 1,
'where' => [
'key' => ('localizator_key' | option),
'resource_id' => 2,
],
]}resource_id — resource ID.
{'pdoResources' | snippet : [
'tpl' => '@INLINE {$value}',
'class' => 'locTemplateVarResource',
'sortby' => 'id',
'limit' => 1,
'where' => [
'key' => ('localizator_key' | option),
'tmplvarid' => 1,
'contentid' => 2,
],
]}tmplvarid — TV IDcontentid — resource ID{1 | locfield : 'tvname'}1 — resource IDtvname — TV name{foreach ('!pdoResources' | snippet : [
'tpl' => '@INLINE {$value | toJSON}',
'class' => 'locTemplateVarResource',
'sortby' => 'id',
'showLog' => 0,
'limit' => 1,
'where' => [
'key' => ('localizator_key' | option),
'tmplvarid' => 30,
'contentid' => $_modx->resource.parent,
],
]) | fromJSON as $spec}
<div class="product-spec-btn">
<a class="btn" href="{$spec.download_data_sheet}" download>{'download_data_sheet' | lexicon}</a>
</div>
{/foreach}Create parameters like work_clock_1_ru, work_clock_1_en and output by current language:
{var $key = ('localizator_key' | option)}
{('work_clock_1_' ~ $key) | option}<a class="header-logo" href="{'site_start' | config}" aria-label="{'site_name' | config}">
{if $_modx->config.cultureKey == 'ru'}
<img src="/assets/images/general/logo_ru.png" alt="{$_modx->resource.pagetitle}">
{else}
<img src="/assets/images/general/logo.png" alt="{$_modx->resource.pagetitle}">
{/if}
</a>{'!Localizator' | snippet : [
'snippet' => 'msCart',
'class' => 'msProduct',
'tpl' => '@FILE chunks/_checkout.cart.tpl',
]}