]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/adding_new_pages_by_using_the_web_interface.mdwn
minor fix-ups
[ikiwiki.git] / doc / todo / adding_new_pages_by_using_the_web_interface.mdwn
1 Perhaps I'm just too stupid to find the proper way to do this, but how
2 would I add a new page to the wiki without selecting to edit an already
3 installed one and frobbing the URL to direct to the to-be-created page?
4 --[[ThomasSchwinge]]
5
6 Good point. Of course one way is to start with creating a link to the page,
7 which also helps prevent orphans. But other wikis based on CGI do have this
8 a bit easier, since they can detect an attempt to access a nonexistant page
9 and show an edit page. Ikiwiki can't do that (unless its web server is
10 configured to do smart things on a 404, like maybe call ikiwiki.cgi which
11 could be modified to work as a smart 404 -> edit handler).
12
13 Some wikis also provide a UI means for creating a new page. If we can find
14 something good, that can be added to ikiwiki's UI. --[[Joey]]
15
16 Hmm, maybe just a preprocessor directive that creates a form inside a page,
17 like is used for blog posting already would suffice? Then the main page of
18 a wiki could have a form for adding new pages, if that directive were
19 included there. Won't work for subpages though, unless the directive were
20 added to the parent page. However, unconnected subpages are surely an even
21 rarer thing to want than unconnected top level pages. --[[Joey]]
22
23 > Here is a simple plugin that does that. Perhaps options could be added to
24 > it, but I couldn't really think of any.
25 > <http://jameswestby.net/scratch/create.diff>
26 > -- JamesWestby
27
28 > For what it's worth, the following works:  
29 > `\[[!inline pages=!* rss=no atom=no postform=yes postformtext="Add a new page titled:"]]`  
30 > Add `rootpage=/` if you do this in `index.mdwn` to avoid creating subpages.
31 > --[[JeremieKoenig]]
32
33
34 Maybe a very simple PHP frontend for serving the
35 statically generated pages, that would display a page editing form or
36 something like that for non-existent pages, wouldn't be too bad a thing
37 and resource hog? Just a thought... --[[Tuomov]]
38
39 ----
40
41 A quick round-up of how other wikis address this problem:
42
43  * mediawiki *used* to Offer a search box with two buttons: 'Go'
44    and 'Search'.  'Go' brought you to a page with the name you
45    typed if it exists, and searches otherwise.  In the latter case,
46    you get a link like this at the top of the search results:
47
48 > *There is no page titled "Testing". You can create this page.*
49
50  * wikia mediawikis have an "add a page" button that pops-up a JS
51    pseudo-window asking for a page name. On submission, you end
52    up at an edit window for the page.
53  * wikipedia now makes it quite hard to create new pages. The old
54    'go' button is gone, nearly all search terms end up at an actual
55    article, a "no results" match does not have helpful create link
56    options.
57  * Moin Moin has a two-button search: "Titles" and "Text".  Neither
58    offer a "create page" option for 0-match searches.
59  * the original c2.com wiki has no helpful link for this either.
60
61 So - the direction of travel would appear to be *away* from having
62 "new page" functionality.
63
64 I would suggest the following for ikiwiki:
65
66  * Extend the search results page to include a "create this page" link,
67    perhaps toggleable, perhaps only if the search term matches some
68    criteria for what makes a sensible page name
69  * Some combination of JamesWestby's "create" plugin, extracting the
70    current stuff inside [[plugins/inline]] (see also:
71    [[more flexible inline postform]]) -- more generally, rationalising
72    where that code lives so it can be used in more contexts.
73  * documenting the `inline` hack above (which I use extensively on my
74    private wikis, by the way!) as a [[tip|tips]].
75
76 -- [[Jon]]