|
Re: [pmwiki] Re: Question to new page format variables: msg#00064web.wiki.pmwiki.user
Patrick R. Michaud wrote: it doesn't matter, why do we need PrintWikiPage? > > Well, I had never really intended for people to call PrintFmt directly > (although I certainly don't exclude the possibility). For example, > instead of doing > > <?php PrintFmt($pagename, "function:PrintGeneralMenu"); ?> > > I would've written > > <?php PrintGeneralMenu($pagename); ?> oops, PrintFmt is really great. It provides all flexibility to customization. For my style of page, I don't like the "sandwiching" of many variables. So I created one PHP file which does the entire layout. This PHP file has several PrintFmt calls, most of them with a list to support fallbacks. Unless there is a serious performance drawback, i will stick with PrintFmt. > > using PHP's built-in function calling syntax. Similarly, instead of > > <?php PrintFmt($pagename, "file:somefile.php"); ?> > > I would expect > > <?php include("somefile.php"); ?> > I do <?php PrintFmt($pagename, "file:\$Group.menu.php $Group.menu.\$lang.php default.menu.php somefile.php"); ?> this is a great feature. > However, there is no PHP equivalent function for displaying a wiki > page, > so I wrote one and called it PrintWikiPage(), thinking that would be > easier for most people than calling PrintFmt(). for me it is not easier. The Page Layout variables support "file", "function" "wiki". By providing the searchlist, PrintFmt is rally great. And it is even better to maintain and to change. I even would like to substitute PrintText($pagename, "[[PmWiki:PmWiki [[\$Version]]]]") by PrintFmt($pagename, "text:[[PmWiki:PmWiki [[\$Version]]]]") By the way: shouldn't FmtPageName("\$action", $pagename) be also swapped to FmtPageName($pagename, "\$action"); to be the similar to PrintFmt as you did with StartHTML. > >> 2. If I use PrintFmt($pagename, "wiki:\$Group.Menu default.Menu") >> Is there a way to find out which page is actually printed. This is >> important >> since I want to specify e.g. a general link to "Edit Menu" within >> the function >> PrintGeneralMenu. > > At present, no. I could modify PrintWikiPage or PrintText to set a > global variable containing the name of the page that is actually being > printed (if so, what should it be called)? > Could we make a function like LookupFmt("wiki:Main.Homepage your.page his.page") LookupFmt("file:local/foo/bar foo/bar") which returns the first alternative found? --bernhard |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Uploads break XHTML: 00064, Edward Andrews |
|---|---|
| Next by Date: | Re: [pmwiki] Re: Approach for handling Diff: 00064, Bernhard Weichel in pmwiki-users |
| Previous by Thread: | Restricting search groupsi: 00064, Patrick R. Michaud |
| Next by Thread: | Re: [pmwiki] Re: Question to new page format variables: 00064, Patrick R. Michaud |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |