A token's length?

Created on 7 October 2024, 4 months ago

Apologies if I am missing something obvious, but how do I return/show the length of a token?

Let's say I don't want to show the token itself, but instead some meaningful length or size of the token. For example, consider the token [some:interesting:object], I don't want to display it, I just want to display it's length (from that point in the tree). Something like [some:interesting:object:length]

💬 Support request
Status

Active

Version

1.15

Component

Miscellaneous

Created by

🇬🇧United Kingdom kmv

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kmv
  • 🇨🇭Switzerland berdir Switzerland

    token types and hierarchy is hardcoded and depending on the parent, the token implemention there needs to find children and allow it to recurse. You can't append something to a token that's not a type.

    Kind of your only option is to define your own [some:interesting:object-length] token, on the same level, as a separate token, duplicate the logic of the token you want the length of and return that.

  • 🇬🇧United Kingdom kmv

    Thanks for replying.

    I had been hoping for some analogue of strlen or sizeof, but understood. Thanks for the clarity.

  • 🇬🇧United Kingdom kmv

    For those following after, here is how I resolved this...

    I used the ' Link Field tweak ' module with a custom PlugIn. This was actually a lot easier than I thought it was going to be.

  • 🇬🇧United Kingdom kmv
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024