Ticket #824 (closed enhancement: fixed)
add WindowTitle shadow tiddler to define document's browser window title text
| Reported by: | EricShulman | Owned by: | MartinBudden |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.6 |
| Component: | core | Version: | |
| Severity: | low | Keywords: | |
| Cc: |
Description (last modified by EricShulman) (diff)
Currently, the browser window's title text is set using a combination of the contents from SiteTitle? and SiteSubtitle?.
In addition to appearing in the titlebar, the browser window's title text is also displayed when the browser is minimized to the system's "task bar" (or other similar interface showing the running applications), and is also used when creating a bookmark for the URL.
This enhancement will allow document authors to specify custom text that will appear in the browser window's title bar, in place of the default combination of SiteTitle? and SiteSubtitle?.
Based on a suggestion from Jeremy, the following code defines a new shadow tiddler, WindowTitle?, and instead of using hard-coded formatting in getPageTitle(), it renders the WindowTitle? content as plain text to set the actual window title text. It also adds a notification so that the window title will be kept in sync when a custom WindowTitle? tiddler is created/modified.
config.shadowTiddlers.WindowTitle="<<tiddler SiteTitle>> - <<tiddler SiteSubtitle>>";
window.getPageTitle=function() { return wikifyPlain("WindowTitle"); }
store.addNotification("WindowTitle",refreshPageTitle);
This code has been successfully implemented at http://www.TiddlyTools.com/#CoreTweaks##824
see also http://trac.tiddlywiki.org/ticket/401 (closed)
