Can I make conditional markups look into includes?

Thomas Hirtenlehner <[email protected]>
Newsgroups gmane.comp.web.wiki.pmwiki.user
Message-ID <[email protected]>
I'm searching for specific keywords in my page to add certain messages in the footer.

For this I added several (:if intext keyword:)...
In the footer.

However, as stated in the documentation, (:if intext... :) does not look into text that comes from an include for example.

Is there a way to circumvent this? The best case would be to make it look only in the main page, but I'm fine with completely circumventing this restriction for certain sites...

8 May 2023 18:35:58 Thomas Hirtenlehner <[email protected]>:

> OK, I should have kept thinking about it. I can solve this problem with the inclusion of intext:
> 
> /(:if2 link mypage.test:)/
> 
> /(:if intext mypage.test#part1:)/
> /Text 1/
> /(:ifend:)/
> 
> /(:if intext mypage.test#part2:)/
> /Text 2/
> /(:ifend:)/
> 
> /(:if2end:)/
> 
> does the trick
> 
> Sorry for bothering everyone :/
> 
> 8 May 2023 16:53:32 Thomas Hirtenlehner <[email protected]>:
> 
>> Hi everybody!
>> 
>> I added the (:if link ... :) markup to my config.php:
>> 
>> /# add (:if link 'Group.Pagename':) conditional
>> $Conditions['link'] = 'IsTarget( $pagename, $condparm )';
>> function IsTarget( $pn, $arg ) {
>>         $arg = ParseArgs($arg);
>>         $pn2 = MakePageName($pn, $arg[''][0]);
>>         $page = RetrieveAuthPage($pn, 'read', true);
>>         if (in_array($pn2, (explode(',',@$page['targets'])))) return true;
>> }
>> 
>> /It works great for determining if there is a link to SOMEWHERE on the given page.
>> 
>> However: I need to discriminate if the link points to a certain anchor, and if so which one.
>> 
>> At the moment the link /[[mypage.test]] /and /[[mypage.test#part3]]/ all lead to the same result.
>> 
>> I'm searching for a behavior, where /(:if link mypage.test:)/ is true for any link to mypage.test, while /(:if link mypage.test#part3:)/ is only true if that specific anchor is addressed somewhere on the page.
>> 
>> Does anyone know of a way to extend the markup given to accomplish that?
>> 
>> thanks a lot in advance!
>> Thomas

_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.