PTVLinkText-Talk

Summary: Talk page for PTVLinkText.
Maintainer: RandyB
Users: (View / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

Is there a way to default to the $Title whenever it exists, and to the $FullName instead of $Name when no $Title has been specified? - RandyB January 04, 2016, at 02:52 PM

Yes, redefine in config.php it like this:
$FmtPV['$Title'] = '@$page["title"] ? $page["title"] : "$group.$name"';"
--Petko January 04, 2016, at 04:05 PM

Doesn't that just redefine the title of the current page, rather than of an arbitrary specified page? How would you return the title of MyGroup.MyPage (if it exists) or the string "MyGroup.MyPage" (if MyGroup.MyPage has no title)? - RandyB January 04, 2016, at 08:51 PM

Didn't it work when you tried it? It redefines the title of the currently evaluated page by the PageVar() function, ie. any arbitrary page specified like {$Title}, {Otherpage$Title} or in a Pagelist template {=$Title}. --Petko January 05, 2016, at 03:27 AM

The above redefines "$Title" for all pages and purposes. If you prefer, you can instead use a diffent variable name, eg. "$TitleOtherwiseFullName" and call that from your function. --Petko January 05, 2016, at 03:39 AM

Thanks. The first solution changed the format for subsequent invocations of [[{$FullName}|+]]] which was a bug. However, the second solution (using a separate page variable name) solves the problem. -- RandyB January 05, 2016, at 02:15 PM

The instructions for this recipe says: "For PmWiki versions 2.2.56 or later" one should use a Markup_e function surely this must be wrong? According to http://www.pmwiki.org/wiki/PmWiki/CustomMarkup Markup_e is deprecated... Johan Bengtsson/2018-02-26

You're right. I've put updating this recipe on my list of things to do. Feel free to update it yourself if you need it done sooner. -- RandyB February 26, 2018, at 10:05 AM

Talk page for the PTVLinkText recipe (users).