[pmwiki-users] Links within a hidden PTV

Petko Yotov 5ko at 5ko.fr
Fri Nov 8 10:15:23 PST 2024


On 08/11/2024 18:29, Martin Cuno wrote:
> In an internal PmWiki I work a lot with the display of backlinks. As
> is well known, the "targets" are stored in the page files for this
> purpose.
> 
> My problem: This storage obviously does not happen if the link in
> question is within a "hidden" PTV, i.e. (:PTV: foo [[foo.bar|text]]
> bar :).
> 
> I am missing these backlinks and I do not want to convert the PTVs to 
> open ones.
> 
> Is there a way to do this? Or would it be a good idea to set up a user
> option (variable) for this?

Yes, there is a way to enbable indexing links in hidden Page text 
variables (PTV).

Add to config.php such a line:

   $SaveAttrPatterns['/\\(:(MyPTV1|MyPTV2):(.*?):\\)/s'] = '$2';

Replace "MyPTV1|MyPTV2" with the names of the variables you want to 
index, separated by "|".

After that, save a page and its targets= attribute will include any 
internal links inside the selected PTVs. Pagelists with backlinks to 
foo.bar will find this page.

Petko




More information about the pmwiki-users mailing list