[pmwiki-devel] Testing existence of pages

0 views
Skip to first unread message

Simon

unread,
Oct 24, 2022, 2:55:19 PM10/24/22
to PmWiki Devel Mailing List
If there a function that can be used in a recipe to test if
* a pagename exists in any group
* a fullname (group.page) exists?

ngā mihi

Simon

Petko Yotov

unread,
Oct 24, 2022, 3:10:13 PM10/24/22
to Simon, PmWiki Devel Mailing List
You can use:

$at_least_one_exists = CondExists("*.MyPage,Group.Otherpage");

Note that this is case insensitive. To make it case sensitive, use:

CondExists("*.MyPage,Group.OtherPage", false);

This should be called after any code that modifies $WikiDir or
$WikiLibDirs. Some skins and recipes do.

Petko

--
If you upgrade : https://www.pmwiki.org/Upgrades

_______________________________________________
pmwiki-devel mailing list
pmwiki...@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Petko Yotov

unread,
Oct 24, 2022, 3:22:25 PM10/24/22
to Simon, PmWiki Devel Mailing List
On 24/10/2022 21:09, Petko Yotov wrote:
> You can use:
>
> $at_least_one_exists = CondExists("*.MyPage,Group.Otherpage");

This tells you that at least one page matches your pattern, but not
which page exactly.

To get the names of these pages, use this instead:

$list = ListPages("*.MyPage,Group.Otherpage");

Petko

Reply all
Reply to author
Forward
0 new messages