[pmwiki-users] Any way to test : if backlink exists ? (then print something)

Petko Yotov 5ko at 5ko.fr
Thu Jan 26 22:39:58 PST 2023


To directly print the backlinks, use a pagelist:

(:pagelist group=Group1,Group2 link=MyPage:)

or, for example in a group footer:

(:pagelist group=Group1,Group2 link={*$FullName}:)

If you don't want all the backlinks but simply different messages 
whether there exist pages with links to here, again this can be done in 
the core with a pagelist, not with a conditional:

(:pagelist group=OtherGroup link={*$FullName} count=1 
fmt=#groupbacklinks:)

Then in Site.LocalTemplates:

(:markup class=norender:)
[[#groupbacklinks]]
(:template first:)
%green% {$$group} has links to {*$FullName}.
(:template none:)
%red% {$$group} has NO links to {*$FullName}.
[[#groupbacklinksend]]
(:markupend:)


If you're set on using a conditional like (:if links OtherGroup.* 
{*$FullName}:), let me know, we can write one.

Petko



On 26/01/2023 21:36, ABClf wrote:
> I'm willing to test if MyPage has backlink(s) in OtherGroup, then
> print backlinks.
> I'm not sure whether native PmWiki will let me do this, or if
> additional markup is requested (in that later case, would someone be
> able to do it) ?
> documentation used :
> https://www.pmwiki.org/wiki/Cookbook/ConditionalMarkupSamples




More information about the pmwiki-users mailing list