<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div style="font-family: sans-serif;">
<span dir="ltr" style="margin-top:0; margin-bottom:0;">OK, I should have kept thinking about it. I can solve this problem with the inclusion of intext:</span> <br> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;"><span style="font-size:large;"><i>(:if2 link mypage.test:)</i></span></span> <br> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;"><span style="font-size:large;"><i>(:if intext mypage.test#part1:)</i></span></span> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;"><span style="font-size:large;"><i>Text 1</i></span></span> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;"><span style="font-size:large;"><i>(:ifend:)</i></span></span> <br> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;"><span style="font-size:large;"><i>(:if intext mypage.test#part2:)</i></span></span> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;"><span style="font-size:large;"><i>Text 2</i></span></span> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;"><span style="font-size:large;"><i>(:ifend:)</i></span></span> <br> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;"><span style="font-size:large;"><i>(:if2end:)</i></span></span> <br> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;">does the trick</span> <br> <br> <span dir="ltr" style="margin-top:0; margin-bottom:0;">Sorry for bothering everyone :/</span> <br>
</div>
<div>
<br>
<div>
<p>8 May 2023 16:53:32 Thomas Hirtenlehner <thomas.hirtenlehner@tielor.at>:</p>
</div>
<blockquote style="margin:0;border-left:3px solid #ccc; padding-left:10px">
Hi everybody!<br> <br> I added the (:if link ... :) markup to my config.php:<br> <br> <i><font size="4"># add (:if link 'Group.Pagename':) conditional<br> $Conditions['link'] = 'IsTarget( $pagename, $condparm )';<br> function IsTarget( $pn, $arg ) {<br> $arg = ParseArgs($arg);<br> $pn2 = MakePageName($pn, $arg[''][0]);<br> $page = RetrieveAuthPage($pn, 'read', true);<br> if (in_array($pn2, (explode(',',@$page['targets'])))) return true;<br> }<br> <br> </font></i><font size="4">It works great for determining if there is a link to SOMEWHERE on the given page. <br> <br> However: I need to discriminate if the link points to a certain anchor, and if so which one.<br> <br> At the moment the link <i><font size="5">[[mypage.test]] </font></i><font size="5"><font size="4">and <i><font size="5">[[mypage.test#part3]]</font></i><font size="5"><font size="4"> all lead to the same result. <br> <br> I'm searching for a behavior, where <i><font size="5">(:if link mypage.test:)</font></i> is true for any link to mypage.test, while </font></font></font></font></font><font size="4"><font size="5"><font size="4"><font size="5"><font size="4"><font size="4"><font size="5"><font size="4"><font size="5"><font size="4"><i><font size="5">(:if link mypage.test#part3:)</font></i> is only true if that specific anchor is addressed somewhere on the page. <br> <br> Does anyone know of a way to extend the markup given to accomplish that?<br> <br> thanks a lot in advance!<br> Thomas<br> </font></font></font></font></font></font></font></font></font></font>
</blockquote>
</div>
</body>
</html>