Thank you for this very helpful funktion!
What about the other wish?
It would be great to have a similar variable that can add the text that is within a paragraph that you link to with the help of an anchor. So you could easily build links like "see Reports > Printing a report" is "Reports" is the topic title and "Printing a report" is the heading of a toggle, for example. If anyone later decides to change "Printing a report" to "Print report", for instance, you won't need to care about updating all links accordingly.
This is exactly what I need as well. I tested the combination of free text and variables in hyperlinks. It works in both the link text and the tooltip
Variable_in_tooltip.png
So with another variable this could be solved.
Edit: While writing, I found the solution in the documentation:
The necessary variable is <%TOPIC_TITLE_PATH%>
Link_with_path.png
Export.png
You do not have the required permissions to view the files attached to this post.