- Posts: 61
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
Wrap it in a <span> (or other element) which you can apply styles to.How do I display it in a larger font size?
Someone may have a more elegant way to do this, but if you are self-hosted you can add the TWIG slice filter to your config.php file and then use it in the TWIG file to extract and combine segments of the token into your format.Is it possible to display it in the following format (000-00000-00-0-0-0)?
'components' => array( 'db' => array( 'connectionString' => 'mysql:host=localhost;port=3306;dbname=limesurvey;', 'emulatePrepare' => true, 'username' => 'username', 'password' => 'password', 'charset' => 'utf8mb4', 'tablePrefix' => 'lime_', ), 'session' => array ( 'sessionName'=>'LS-SMRVRMDZUKTSFGRQ', // Uncomment the following lines if you need table-based sessions. // Note: Table-based sessions are currently not supported on MSSQL server. // 'class' => 'application.core.web.DbHttpSession', // 'connectionID' => 'db', // 'sessionTableName' => '{{sessions}}', ), 'urlManager' => array( 'urlFormat' => 'path', 'rules' => array( // You can add your own rules here ), 'showScriptName' => true, ), 'twigRenderer' => array( 'sandboxConfig' => array( 'filters' => array( 'slice', ), ), ), ),
{% set token = processString('{TOKEN}') %} {% set t1 = token|slice(0, 3) %} {% set t2 = token|slice(3, 5) %} {% set t3 = token|slice(8, 2) %} {% set t4 = token|slice(10, 1) %} {% set t5 = token|slice(11, 1) %} {% set t6 = token|slice(12, 1) %} {% set formattedToken = t1~'-'~t2~'-'~t3~'-'~t4~'-'~t5~'-'~t6 %} <span style="font-size: 1.3em;">{{ formattedToken }}</span>
Please Log in to join the conversation.
Please Log in to join the conversation.