Updating (refreshing) the "Link Text" after creating an "Inline Item Link"?

Submitted by dderkits on 2025/03/17 17:13

Scenario:

1) Create new Item X, containing a text string such as "this is original text".

2) Create new Item Y and type "[[" within Item Y to bring up the "Embed Link to..." dialog.

3) In Item Y, use the dialog to embed a link to Item X (with "Use Item Text" checkmarked in the dialog).

4) Now, Item Y displays a clickable link ("this is original text") that points to Item X.

5) Modify the text of Item X, such as "this is MODIFIED NOT original text".

Is there a way to update/refresh Item Y such that Item Y now displays the clickable link "this is MODIFIED NOT original text" that points to Item X?

Thanks

Comments

It is "feasible" but a bit complex:

  1. Use the Instr function to find the position of the string "<A href=" & chr(34) & "about:" & ItemID & chr(34) & ">"
  2. Use the Instr function to find the position of the next "</A>"
  3. Set the field value to something like Left(Field1,i) & "<A href=" & chr(34) & "about:" & ItemID & chr(34) & ">" & NewItemText & Mid(Field1,j)
    (where i and j are the position returned by step 1 and 2 respectively)

Thanks. I used to be fairly proficient with VBScript. This will be a good opportunity to refamiliarize myself.

As an aside, I see that the "Use Item Text" truncates the text of the embedded link to 100 characters (the "Use Item Text" checkbox alerts this by displaying a yellow background and a pop-up comment on mouse-over). Is it possible to remove (or extend) the limitation? (maybe with an Options entry?)

In the end, what I would like to accomplish is the ability to create an Item ("Item Y") that is a text string that is built from a combination of 1) text that I type directly into Item Y and 2) text that I bring in from other items (e.g. "Item X") by using the "embed link" feature. Because the text in the other items, e.g. Item X, would be subject to change down the road, I would like to be able to update Item Y with the current text of the embedded items (e.g. Item X).*** I agree that toggling a Y/N field would be a good way to trigger the update of Item Y.

I guess this does raise the question whether there is a better way to do this, that I haven't thought of (or yet discovered in IQ).

***To make this less abstract:

Item Y contains this text string (with two embedded links, in bold):
Ted's current recommendation is sell and the Adam's current recommendation is buy.

Item X contains this test string: sell
Item W contains this text string: buy
And Item Y has embedded links to Item X and Item W.

And there could also be another item, Item Z, that (similar to Item Y) uses the embedded links:
Item Z contains this text string (with two embedded links, in bold):
FYI, the latest update is Ted says sell and Adam says buy.

How do I ?