also tag 'patch/core', considering that over half of the changes are there
[ikiwiki] / doc / todo / more_customisable_titlepage_function.mdwn
1 I understand the `IkiWiki::titlepage` function is used to generate filenames from titles. It would be nice if there were an easier way to override what it does. I suppose I could write an *external* plugin and call `inject`, but maybe this could instead be done via the configuration file?
2
3 I imagine two things: a lookup hash and a template.
4
5 Since `IkiWiki::titlepage` basically translates characters, it would be cool to be able to define a lookup hash in the configuration, which would be consulted before falling back to the generic `__xx__` `ord()` representation of a letter. For instance, in German, I might prefer to have 'รค' become 'ae' instead of something illegible.
6
7 > This is [[todo/unaccent_url_instead_of_encoding]]. --[[smcv]]
8
9 Second, maybe a template could be honoured. The template could have a slot `%s` where the calculated title goes, and it could contain `strftime` symbols as well as variables, which get interpolated on use.
10
11 Another option would be a function I could define in the setup file, or an external script, though that would be pretty expensive.
12
13 -- [[madduck]]
14
15 > This somewhat resembles [[todo/inline_postform_autotitles]].
16 > Another way to do this, suggested in that todo, would be to
17 > pre-fill the title field with YYYY/MM/DD/ using Javascript.
18 > --[[smcv]]
19
20 I don't think that changing titlepage is a good idea, there are
21 compatability problems.
22
23 Instead, I think that in the specific case of the blogpost form, there
24 should be an interface to allow plugins to do arbitrary transformatiosn of
25 the page name.
26
27 So, add a hidden field to blogpost.tmpl, something like blogpost=1. Then in
28 `editpage`, if blogpost is set, call the blogpost hooks, which are passed
29 a page name and return a transformed version.
30
31 If the page name is changed by those, then the user's original title might
32 need to be preserved via a meta title directive. This could just be
33 inserted if any changes are made to the page name. Only problem with this
34 is that having the directive appear in the edit box for a new page could
35 confuse the user. The title could be passed on in a hidden field, and
36 prepended to the page when it's saved..
37
38 --[[Joey]]
39
40 > I'll pass on these comments to the two similar todo items. --[[smcv]]
41
42 [[wishlist]]