Re: [pmwiki-users] IncludeText doc
On Wed, Feb 14, 2007 at 11:37:53AM -0500, Pierre Racine wrote: >Hi list, > >is "function IncludeText($pagename, $inclspec)" documented somewhere? > >I want to read template string enclosed between [[#templatename]] and >[[#templatenameend]] similar to the one in PageListTemplates. I fill that >IncludeText is the right function to do this but I can't figure what >are its arguments... Actually, this particular capability (grab a template enclosed between two anchors) is expected to become its own function, which pagelist templates and include will use. In the meantime, the arguments to IncludeText are $pagename -- the current page $inclspec -- the specification for the include (i.e., it's the argument to the (:include ...:) directive) Thus, calling IncludeText("Group.Page", "ABC#def#ghi") would return the text between the [[#def]] and [[#ghi]] anchors on page Group.ABC. Pm ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] IncludeText doc
Thanks Pm, I can add that if we do not specify the ending anchor, the starting anchor suffixed with "end" is assumed. Ex.: [[#anchorname]]bla, bla, bla...[[#anchornameend]] And what is the usage of the last boolean (true/false) argument? Pierre >-Message d'origine- >De : Patrick R. Michaud [mailto:[EMAIL PROTECTED] >Envoyé : 14 février 2007 13:36 >À : Pierre Racine >Cc : pmwiki-users@pmichaud.com >Objet : Re: [pmwiki-users] IncludeText doc > >On Wed, Feb 14, 2007 at 11:37:53AM -0500, Pierre Racine wrote: >>Hi list, >> >>is "function IncludeText($pagename, $inclspec)" >documented somewhere? >> >>I want to read template string enclosed between >[[#templatename]] and >>[[#templatenameend]] similar to the one in >PageListTemplates. I fill that >>IncludeText is the right function to do this but I can't >figure what >>are its arguments... > >Actually, this particular capability (grab a template enclosed between >two anchors) is expected to become its own function, which >pagelist templates and include will use. > >In the meantime, the arguments to IncludeText are > >$pagename -- the current page >$inclspec -- the specification for the include (i.e., it's the > argument to the (:include ...:) directive) > > >Thus, calling > >IncludeText("Group.Page", "ABC#def#ghi") > >would return the text between the [[#def]] and [[#ghi]] >anchors on page Group.ABC. > >Pm ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Re: [pmwiki-users] IncludeText doc
On Thu, Feb 15, 2007 at 08:59:47AM -0500, Pierre Racine wrote: > I can add that if we do not specify the ending anchor, the > starting anchor suffixed with "end" is assumed. Ex.: [[#anchorname]]bla, > bla, bla...[[#anchornameend]] In the current implementation, if no ending anchor is provided then the next anchor in the text is used. The use of an "end" suffix is a convention we've been using and encouraging, but it's not actually coded anywhere. I've been thinking of modifying the routine slightly so that if no anchor is specified, then we use the "end" suffix if it exists and the next anchor if not. But PmWikiPhilosophy #3 applies -- so far I haven't heard from anyone who needs the capability to include blocks of text containing anchors. > And what is the usage of the last boolean (true/false) argument? I got rid of the third argument some time ago... but apparently I forgot to update the call to IncludeText() in scripts/pagelist.php . It was originally used to tell IncludeText() to process any '&', '<', '>', etc. characters in the retrieved text. It'll undoubtedly be corrected when I add the section retrieval code. Thanks! Pm > > >-Message d'origine- > >De : Patrick R. Michaud [mailto:[EMAIL PROTECTED] > >Envoyé : 14 février 2007 13:36 > >À : Pierre Racine > >Cc : pmwiki-users@pmichaud.com > >Objet : Re: [pmwiki-users] IncludeText doc > > > >On Wed, Feb 14, 2007 at 11:37:53AM -0500, Pierre Racine wrote: > >>Hi list, > >> > >>is "function IncludeText($pagename, $inclspec)" > >documented somewhere? > >> > >>I want to read template string enclosed between > >[[#templatename]] and > >>[[#templatenameend]] similar to the one in > >PageListTemplates. I fill that > >>IncludeText is the right function to do this but I can't > >figure what > >>are its arguments... > > > >Actually, this particular capability (grab a template enclosed between > >two anchors) is expected to become its own function, which > >pagelist templates and include will use. > > > >In the meantime, the arguments to IncludeText are > > > >$pagename -- the current page > >$inclspec -- the specification for the include (i.e., it's the > > argument to the (:include ...:) directive) > > > > > >Thus, calling > > > >IncludeText("Group.Page", "ABC#def#ghi") > > > >would return the text between the [[#def]] and [[#ghi]] > >anchors on page Group.ABC. > > > >Pm > ___ pmwiki-users mailing list pmwiki-users@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-users