Given the below config.php configuration for device ui custom links: $config['html']['device']['links'][] = ['url' => '<insert-url>{{ $device[\'sysName\'] }}', 'title' => 'Open-AudIT'];
Example based on the sysname or OS I would like to provide a different url
- OS APC Management Module AOS would generate a url of {{ $device[‘sysName’] }}.ini
- OS Opengear would generate a url of {{ $device[‘sysName’] }}.xml
- All other OS would generate a url of { $device[‘sysName’] }}.cfg
I am playing with shorthand conditionals in php, and I tried the below with no luck:
$config['html']['device']['links'][] = ['url' => 'https://gitlab.example.com/config-backups/{{ $device[\'sysName\'] }}' . ($device[\'osname\'] == 'Opengear') ? '.xml' : (($device[\'osname\'] == 'APC Management Module AOS') ? '.ini' : '.cfg'), 'title' => 'Config Backups'];
Any help is appreciated!
Thanks!