00779: (:title

 directives should not have effect in (:include:) included pages:)
Summary: (:title:) directives should not have effect in (:include:) included pages
Created: 2006-07-28 08:24
Status: Closed - added $EnablePageTitlePriority for 2.2.9
Category: Feature
Assigned:
Priority: 55544
Version: 2.1.11
OS: Win/Apache/4.4

Description: Announced as being fixed in 2.1.6 (http://article.gmane.org/gmane.comp.web.wiki.pmwiki.user/26922/match=include+title+directives+don+t+mix) but problem still persists.

  • Was called 'not a bug' in PITS.00266 JamesM
  • Consider this use case FOR blocking included title directives.
    1. A page called 'mynavigator' with a list of pages and a :Title The Big Navigator: directive.
    2. An :include mynavigator: on a number of pages that are using the navigator
    3. Now all pages would have the same title, The Big Navigator, for any tools that respect thier renamed title when listing them!
  • In fact, much as you use $= $* and $ to give context to variables, some directives may need to have specific contexts

Suggestion:

Title is a form of page-specific metadata. There should be a metadatablock at the beginning of a page where you can assign arbitrary key=value pairs that can be used by other tools. These are locked to and evaluated in the page context, even if the page is included in another scope.
  • So perhaps if a final page has two consecutive titles, the second one is being used instead of the first. Perhaps this could be reversed and even a variable added to specify whether the first or last metadata have priority on a page.

Solution by using recipe TitleMarkup as an alternative title markup which will display first title. HansB April 03, 2008, at 10:32 AM

FWIW, I use and need to set the title from an included page. I am using every day wikipages in a log-like configuration where the page name is 20090203 and the GroupFooter contains (:title [{*$:myvar} - {*$:myvar2}] {(ftime {*$Name} "%A %d %B")} :). This displays as title two PageTextVariables from the page and the date, rendered as "Tuesday 03 February" in a local language.

You can completely disable title directives in included pages by adding to config.php such a code:
$QualifyPatterns['/\\(:title\\s(.*?):\\)/i'] = '';
Do we need to add something to the core, or will an update of the documentation be enough? --Petko February 02, 2009, at 11:16 PM

Intuitively for beginner & intermediate users they will expect the first title directive to "win". If an administrator knows he/she has need for the (non-intuitive) last-title-directive-wins behavior then that should be something explicitly set to vary from the default. Administrators know how to fix configuration variables and have access to do so; therefore a change in core would result in the most logical default configuration. My vote is to change core. Just my $0.02... (An alternative might be to have some sort of (:title-override This Title Wins:). Then you can explicitly choose to have an override occur from an include without making a configuration change. Not sure if that's good or not...) Peter Bowers February 03, 2009, at 12:09 AM

This PITS entry is about title directives in included pages, and not about if the first or last title "wins". The code I suggested fixes just that. --Petko February 03, 2009, at 01:06 AM