- Устанавливаем через composer в папке core:
composer require mobiledetect/mobiledetectlib - Создаем сниппет detectMobile, который будет отвечать за определение:
<?php require_once MODX_CORE_PATH . '/vendor/autoload.php'; $detect = new \Detection\MobileDetect; $deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer'); if ($input == $deviceType) { return true; } - Подключаем fenom и создаем правило в чанках или шаблоне:
{if 'phone' | detectMobile} The phone detected {else} {/if}
MODx