00039: $Titlespaced variable and $AsSpaced functions not available

Summary: $Titlespaced variable and $AsSpaced functions not available
Created: 2004-09-15 22:30
Status: Closed, added for 2.0.devel13
Category: Feature
From: jr
Assigned:
Priority: 45
Version: 2.0dev4
OS: OSX/Apache1.3.29/Php4.3.2

Description: In PmWiki 1 it is possible to (a) use $Titlespaced instead of $Title and (b) substitute a local AsSpaced function. For example, this allows the WikiCalendar to display page names as 2004 09 16. One can do it manually with the [:title Spaced Title:] directive, but automation is better.


I just haven't figured out how I want to deal with [:spacewikiwords:] and AsSpaced yet. But I'm glad it's in PITS now so I don't forget it (and it has an appropriate priority on it). --Pm

Some questions and possible answers:

What should happen about references to $Name?

option 1
change [:spacewikiwords:] to [:spacewikinames:] and it spaces both wiki words and $Name in the title bar.
option 2
add a separate [:spacewikinames:] directive that causes $Name to be spaced.
option 3
introduce a $Namespaced variable (akin to $Titlespaced).

It always felt a bit inconsistent that in PmWiki 1 spacewikiwords doesn't space the group or title.

Should wiki words be spaced by default?

With the greater weight being given to [[page name]] markup, perhaps:

  • $Name should be spaced by default
  • wiki words should be spaced by default
  • an author can disable spacing with a [:joinwikiwords:] directive

Do we still need an AsSpaced function?

Yes, so an administrator can override the default capitalisation; eg to display Terms of Reference instead of Terms Of Reference; or to display FrameMaker or PmWiki instead of Frame Maker and Pm Wiki.

As an alternative, I've added a cookbook entry to create spaced WikiWords and handle spacing of titles in pages. It's a different approach and I'm not saying it's the right one, but it works now if you need it and it presents a different way of thinking about the problem. LarryBaltz

I like the comments above, especially the points about $Name being spaced by default, and WikiWords being spaced by default. I think it's safe to assume that if there is a $SpaceWikiWords variable, then ALL WikiWords should be spaced (Groupname, Pagename, and body text). Why would somebody want to enable something like that, but now apply it to Titles and such? I don't think it makes any sense. Either you want em or you don't. I think enabling the spacing by default is a great idea too. - Steven Leite
Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=PITS%2f00039
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=PITS%2f00039
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/PITS/00039
            [REDIRECT_SCRIPT_URL] => /wiki/PITS/00039
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afKTyezThfGhdg79wukcngAAABI
            [REDIRECT_URL] => /wiki/PITS/00039
            [REMOTE_ADDR] => 216.73.216.31
            [REMOTE_PORT] => 9712
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/PITS/00039
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/PITS/00039
            [SCRIPT_URL] => /wiki/PITS/00039
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afKTyezThfGhdg79wukcngAAABI
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777505225.6258
            [REQUEST_TIME] => 1777505225
            [argv] => Array
                (
                    [0] => n=PITS%2f00039
                )

            [argc] => 1
        )

)