Prefixing/suffixing content plugin fields

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

Prefixing/suffixing content plugin fields

Post by *funkymonk »

Hello.

The TC help for "Dialog box: Custom columns" says:

---
[="prefix"pluginname.fieldname.unit"suffix"]
The strings prefix and/or suffix will only be shown when the field "fieldname" exists and has a valid value in plugin pluginname. For example, you can use this to show a measurement unit when the field is present, and nothing when the field is not present.
---

This is great.

Not sure this is a bug, but: new line chars (and other escaped chars) are not interpret in the prefix/suffix string (TC 10.00).

I can understand this if the feature is used for creating custom views (where most escape sequences don't make sense).
However, it would be great to have such escape sequences in tooltips (here, "\n" is displayed instead of a line break).

Maybe it is an option to simply ignore escape sequences for the custom views but accept them for tooltips?

What do you think?

BR
funkymonk
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Prefixing/suffixing content plugin fields

Post by *petermad »

2funkymonk
Have you tried putting the new lines between the content values - like:

Code: Select all

[="prefix"pluginname.fieldname.unit"suffix"]\n[="prefix2"pluginname.fieldname2.unit"suffix2"]
See also: https://www.ghisler.ch/board/viewtopic.php?p=402833#p402833
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

Re: Prefixing/suffixing content plugin fields

Post by *funkymonk »

petermad wrote: 2021-06-29, 21:44 UTC 2funkymonk
Have you tried putting the new lines between the content values
Yes. This works and is often sufficient -- but not always.

Sometimes, a "conditional newline" would be helpful, which creates a new line only on case a certain content field is available for the file.
Therefore, "\n" within the prefix/suffix would be nice to structure the tooltips.

---

Here is one (out of several) scenarios I have:

Let's assume we apply several content plugins to a file to create the tooltip.
For an assumed pdf that is part of a git repository, the tooltip could look like this:

Code: Select all

--- PDF ---
Author: <name>
Title : <title>
...

--- GIT ---
Repo  : <repo>
Age   : <age>
...

--- General ---
Type:
Size:
Date:
The pdf plugin is set up for pdf files (*.pdf*) only.
The git plugin needs to be set up for all files (*.*) but only makes sense for files that belong to a git repository.
Thus, I want the GIT section to appear only if the file belongs to a git, i.e, if "gitcmd.Branch" is valid. I would therefore use

Code: Select all

[="--- GIT ---\n"gitcmd.Branch" @ "][=gitcmd.FirstRemoteUrl]
to create the first two lines of the section.
If I put the "\n" outside of the prefix then I have to put "--- GIT ---" outside of the prefix as well.
This makes "--- GIT ---\n" unconditional and the section will always be displayed even if the file is not part of a repository.

---

What do you think?

BTW: I use a monospaced font (Consolas) in addition to consistently structuring tooltips this way. The resulting visual layout helps me a lot to get the required information very fast, even if a lot of information is available for some file types. Maybe this approach is helpful to other users as well.

BR
funkymonk
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Prefixing/suffixing content plugin fields

Post by *petermad »

2funkymonk
What do you think?
I can see the benefit of support for \n inside the prefix of postfix in situations like this - but maybe it is rather a feature request, than a bug.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

Re: Prefixing/suffixing content plugin fields

Post by *funkymonk »

petermad wrote: 2021-06-30, 09:29 UTC 2funkymonk
I can see the benefit of support for \n inside the prefix of postfix in situations like this - but maybe it is rather a feature request, than a bug.
You are probably right.

I was not sure if escape sequences were supposed to work in suffix/prefix strings (then it would have been a bug) or not (then it is a feature request).

Can someone move this post to the suggestions forum (I cannot)?

Thank you.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Prefixing/suffixing content plugin fields

Post by *Hacker »

Moderator message from: Hacker

Moved to the suggestions forum.
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply