[pmwiki-users] Displaying one page's source markup on another page
Randy Brown
randy at brownragfilms.com
Tue Oct 28 13:02:18 CDT 2014
Thanks, Petko. That works.
Randy
On Oct 28, 2014, at 12:00 PM, pmwiki-users-request at pmichaud.com wrote:
>
> Date: Mon, 27 Oct 2014 21:16:42 +0100
> From: Petko Yotov <5ko at 5ko.fr>
> To: pmwiki-users at pmichaud.com
> Subject: Re: [pmwiki-users] Displaying one page's source markup on
> another page
> Message-ID: <5b7f7deebe0a31a807920503e6485f31 at 5ko.fr>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Something like this in config.php may work:
>
> $FmtPV['$Source'] = 'PreserveSource("$group.$name")';
> function PreserveSource($pn) {
> $page = RetrieveAuthPage($pn, 'read', false, READPAGE_CURRENT);
> return "[@{$page['text']}@]";
> }
>
> Then in a wiki page, use
>
> {Main.HomePage$Source}
>
> Petko
>
> The return line should probably be more like
>
> return Keep("<pre>{$page['text']}</pre>");
>
> otherwise if the page text contains [@ or @] it may break.
>
> P.
More information about the pmwiki-users
mailing list