LESS Function -evo-widgetfile-url does not work as expected in Verint 12

I'm using a similar template to generate CSS from LESS styles as in the Site Theme (variables.less => variables.vm), to define styles for the widget based on some environment conditions and configuration settings.

I found that "-evo-widgetfile-url" does not work as expected in Verint 12.0.3.17950. But this function working well in Verint 11.1.x versions.

Sample code to reproduce this issue:

Widget Content component code:

$core_v2_page.AddLink('stylesheet', $core_v2_widget.GetExecutedFileUrl('render-styles.less'), "%{ Position = 'AfterTheme' }")

<div class="unique-wrapper">
</div>

Widget "render-styles.less" code:

@import "-evo-widgetfile-url('variables.vm')";

Widget "variables.vm" code:

#if ($core_v2_user.Accessing.Username == $core_v2_user.AnonymousUserName)
    .unique-wrapper {
        height: 100px;
        background: blue;
    }
#else
    .unique-wrapper {
        height: 100px;
        background: green;
    }
#end

On the page where this widget placed I see the following output in the network tab for my widget style file:
@import "-evo-widgetfile-url('variables.vm')";

Parents
  • I think this is because the imported theme (via addlink) is now cached so any dynamic changes would potentially not work as expected 

    I'd suggest you add the dynamic styling as per the stock widgets using style.vm such as the featured content carosel which has a style.less for commonm styling and style.vm for dynamic elements 

    $core_v2_page.AddLink('stylesheet', $core_v2_widget.GetExecutedFileUrl('style.less'), "%{ Position = 'AfterTheme' }")
    $core_v2_widget.ExecuteFile('style.vm')

Reply
  • I think this is because the imported theme (via addlink) is now cached so any dynamic changes would potentially not work as expected 

    I'd suggest you add the dynamic styling as per the stock widgets using style.vm such as the featured content carosel which has a style.less for commonm styling and style.vm for dynamic elements 

    $core_v2_page.AddLink('stylesheet', $core_v2_widget.GetExecutedFileUrl('style.less'), "%{ Position = 'AfterTheme' }")
    $core_v2_widget.ExecuteFile('style.vm')

Children