On Tuesday 19 January 2010 19:33:27, Dominique Faure wrote : > On Tue, Jan 19, 2010 at 18:45, Petko Yotov <[email protected]> wrote: > > On Monday 18 January 2010 21:59:07, Dominique Faure wrote : > >> I didn't had a look at the code, but it would be great to have some > >> kind of markup directive which could temporary prevent title > >> propagation (by setting $EnablePageTitlePriority to 1). > > > > It will not be easy. When the markup is being processed, all markup rules > > are already defined. Then the two "modes" of the title are processed > > differently. > > > > The old one is processed with other directives, after all included > > sections have been brought into the page -- this is how it worked, we > > don't want to change it for people who need it. > > > > The new one is processed before the inclusion of other sections, so that > > the real page have the priority for setting the title. If the page > > doesn't set a title, the first included section containing (:title:) will > > set it. > > > > It is possible to change the markup rules, or to set a switch for a > > function to accept or not a subsequent (:title:) directive, but it is not > > possible to change the "when" part ("directives" or "<include") for an > > existing markup, so this will be a mess. > > > > When we edit a page, PmWiki knows it is on PageName, but the markup it > > renders comes from Site.EditForm. > > * If there is no (:title:) directives in EditForm or in the inclided > > pages like EditQuickReference, the page will show the title from the > > $page['title'] attribute like it should. > > * If there is a (:title:) directive in EditForm or in the pages it > > includes, this overrides the $page['title'] attribute and appears as > > title. > > Why not having a (:localtitle ...:) directive which defines the page > title only while the page is directly displayed?
I'd like to see this as a recipe. The problem when we edit a page, is that PmWiki thinks that page is "directly displayed", but renders another source markup, from Site.EditForm -- and it will accept the (:localtitle...:) as legitimate. > IMHO, after a (quick) look at the code, I would have considered the > following alternative implementation: > * The (:title ...:) directive is only pushing the different title > definitions onto a stack. > * Then, a post processing rule is choosing the top or bottom > definition from the stack according to the current configuration and > set it as the effective page title. Unfortunately, the stack will not be the same if the (:title...:) directive is processed before or after (:inlude...:), and this has to be decided before the markup is processed. :-) If a page has 2 (:include...:) markups, the old-way-title stack would look like this: 1. title from GroupHeader 2. title on top - first line of the browsed page 3. title in an included page A 4. title from another included page B 5. title at the bottom - last line of the browsed page 6. title from GroupFooter Here the last found, in that order, becomes the title. The new-way-title stack, in the same configuration as before, would be like this: 1. title on top - first line of the browsed page 2. title at the bottom - last line of the browsed page 3. title from GroupHeader 4. title in an included page A 5. title from another included page B 6. title from GroupFooter Here the first found, in that order, becomes the title. Petko _______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users
