[Pmwiki-users] Re: Include doesn't work in SideBar

Patrick R. Michaud pmichaud
Mon Mar 22 14:31:02 CST 2004


On Mon, Mar 22, 2004 at 08:11:46PM +0100, Christian Ridderstr?m wrote:
> On Mon, 22 Mar 2004, Patrick R. Michaud wrote:
> 
> > Feature.  The only place that [[include:]] and its sisters ([[redirect:]],
> > etc.) work is in the main body of the text.  This also has impacts
> > on the diff and other outputs.
> 
> IMHO it's a bug, at least sometimes.

It's primarily a function of how PmWiki was originally put together.
It wasn't convenient to put the [[include:]] directive into the PrintText
routine, so it was placed in HandleBrowse.  After that it was moved to
ProcessTextDirectives so that it could be used by other modules (e.g.,
page preview).

It's one thing to just say that "[[include:]] should always just work",
but there are other dependencies involved as well.  Should [[include:]]
be processed before or after including the group header pages?
Currently it's before, so that an include file can specify [[nogroupheader]],
[[nogroupfooter]], [[notitle]], etc., to disable some headers and footers.  
If we move [[include:]] processing to after those sections then it 
changes the dynamics of the page rendering quite a bit.

We could do [[include:]] processing multiple times, but that gets confusing.
("Q: I included a file that specifies [[nogroupheader]] and it did't get
processed--how come?" "A: Well, your file got processed by the second-pass
of [[include:]], which comes after the group header/footer processing
so it doesn't count.")  And there are some times that we just don't want
[[include:]] and [[noheader]] processing performed, such as when
displaying page revision output.  Or, put another way, if someone puts
"[[notitle]]" or "[[redirect:]]" in the sidebar, should it be honored?  
What if the sidebar page does "[[include:]]" of another page that
contains "[[notitle]]" or "[[redirect:]]"?

Is there a consistent rule that one can come up with for all of the
various directives that take place?

Pm




More information about the pmwiki-users mailing list