File Window Tip

Started by axel.hennig, March 20, 2023, 01:40:14 PM

Previous topic - Next topic

axel.hennig

Based on the currently ongoing discussion regarding the File Window Tip I had a deeper look into this and wanted to test things. I've started simple and tried:

{File.Categories.Direct|prefix:<Run FontSize='12pt'>;postfix:</Run>;replace:~;==<LineBreak/>}
But this does not produce "real" linebreaks, it just displays the word "<LineBreak/>". What am I doing wrong? I've worked with the example in this help-page.

Mario

#1
This is a bit tricky. The row output of your variable produces a Run using prefix and postfix (for the font size).
You cannot add <LineBreak/> to a <Run>.

How to introduce hard line breaks is for example shown in the row for the Description tag in the default File Window Tip.
You have to close the run, add your line break, and then re-open the run.

In your example, this will work:

{File.Categories.Direct|prefix:<Run FontSize='12pt'>;postfix:</Run>;pereplace:~;==</Run><LineBreak/><Run>}

Note the use of pereplace instead of replace to avoid the special characters < and > being stripped out during escaping.

Without the Run it becomes simpler:

{File.Categories.Direct|pereplace:~;==<LineBreak/>}
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

JohnZeman

Below is the way I display Hierarchal Keywords in a file window tip.
First I use replace to replace ; with temporary text XXX then I use pereplace to replace XXX with <LineBreak/>


Mario

{File.MD.hierarchicalkeywords|pereplace:~;==<LineBreak/>}

Should so it, unless you do complex runs etc.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

axel.hennig

Thanks to both of you. Works perfect.