Can I 'cut' in the modern ui?

Trying to use the old s:Cut but no joy!

Tried @s.Cut cut="substring" and a couple of other versions but no joy.

 

Anyone know of any other built-in way to cut a substring from results?

 

thx

mark

Hi Mark -

 

Congratulations on making the switch to the Modern UI - I trust that you'll find the speed boosts and newfound flexibility are worth it.

 

The Modern UI templating system uses Freemarker - a quick overview of Funnelback's usage of Freemarker is available at:

 

http://docs.funnelback.com/freemarker.html

 

Equivalent functionality to s:Cut in Freemarker can be seen in the default Modern UI form (simple.ftl) when removing the 'http://' prefix on results' URLs: ... <@s.cut cut="http://"><@s.boldicize>${s.result.displayUrl} ...

Similar functionality can be achieved using the Freemarker 'replace' built-in directive: ... <@s.cut cut="http://"><@s.boldicize>${s.result.displayUrl} ...

Happy templating.

Thank, Gordon; I'll check this out later today...

mark

Thanks for this: the 'replace' built-in directive (the second example) worked; the first did not.

But a good result!!

If you're missing the import statements to bring in the funnelback.ftl and funnelback_classic.ftl macros, the @s.cut macro will generate Freemarker errors.

<#ftl encoding="utf-8" />
<#import "/web/templates/modernui/funnelback_classic.ftl" as s/>
<#import "/web/templates/modernui/funnelback.ftl" as fb/>
...

See also: