]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/ikiwiki/pagespec/discussion.mdwn
ikiwiki (3.20130711) unstable; urgency=low
[git.ikiwiki.info.git] / doc / ikiwiki / pagespec / discussion.mdwn
1 I am using ikiwiki 2.6.1.
3 I can't figure out the locked pages.
5 As an admin in preferences, I put in my Locked Pages:
7 index and downloads
9 I don't want anyone to be able to edit the front page or my downloads page.
11 That didn't work. I am using a different web browser as a different non-ikiwiki-admin user.
13 So I changed it to
15 /index and /downloads
17 That stopped me from editing the front page. It didn't say it was locked just repeatedly gave me the ikiwiki login. (How can I get it to tell me it is locked instead?)
19 I also tried
21 /index and /downloads/index
23 But I could still edit my downloads page.
25 Can someone share some hints on how to lock these two pages?
27 My source pages for the lock are:
29 source/downloads.mdwn
30 source/index.mdwn
32 My webpages to lock are:
34 public\_html/downloads/index.html
35 public\_html/index.html
37 > So I tried again with using "or" instead of "and":
38 >
39 > index or downloads
40 >
41 > And that worked. I now get a message saying it is locked and cannot be edited.
42 > To me saying "lock both 'index and downloads'" made sense while now it reads like: "lock either 'index or downloads'". Maybe the [[PageSpec]] should define "and" and "or" (beyond the examples it has).
43 >
44 > Also why did my "/index and /downloads" prevent editing the index by repeatedly showing login webpage?
45 >
46 > -JeremyReed
48 >> I've clarified and/or in [[PageSpec]].
49 >> 
50 >> I can't reproduce "/index and /downloads" causing the login webpage to
51 >> be shown repeatedly. Sure you weren't having some independent issue with
52 >> logging in? --[[Joey]]
54 ----
56 I have a page for a tag.  On that page I want to list every page on my wiki that has been so tagged.  Easy enough, right?
58 > \[[!inline pages="link(Categories/Ikiwiki_Plugins)" feeds=no archive=yes sort=title template=titlepage]]
60 > (I'm using tagbase => "Categories" because I'm converting from Mediawiki) 
62 This works beautifully in my sandbox: <http://iki.u32.net/sandbox>  But it is totally blank on the page where I actually do want output!  <http://iki.u32.net/Categories/Ikiwiki_Plugins>
64 How can I fix this?  --[[sabr]]
66 > I don't see why that wouldn't work. Can I download the source to your
67 > wiki from somewhere to investigate? --[[Joey]]
69 ----
71 Should negation work with user(), with locked_pages in setup?  I
72 experimented with setting locked_pages => 'user(someuser)' and was able to
73 edit as a different user.  However, setting locked_pages =>
74 '!user(someuser)' doesn't seem to allow edits for only 'someuser' - it
75 locks out all users.
77 > Negation works with anything in any PageSpec. I tested the case you
78 > describe, and a negated pagespec worked for me; all users except the
79 > listed user (and except wiki admins of course) were locked out.
80 > --[[Joey]] 
82 >> It must be a local problem, then, cause I've tried it with two separate 
83 >> machines.  Both are running the most recent release of ikiwiki in 
84 >> pkgsrc - 2.66.  Perhaps an update to a newer version would solve the issue.
86 ----
88 Is there a way to refer to all subpages of the current page, if  the name of the 
89 current page is not known (i.e. the pagespec is used in a template)? The ./ syntax
90 does not seem suitable for this, as
92 > \[[!map pages="./*"]]
94 also lists the current page and all its siblings.
96 ---
98 I am a little lost. I want to match the start page `/index.mdwn`. So I use
100     \[[!inline pages="/index"]]
102 which does not work though. I also tried it in this Wiki. Just take a look at the end of the [[SandBox|sandbox]]. --[[PaulePanter]]
104 > Unlike wikilinks, pagespecs match relative to the top of the wiki by
105 > default. So lose the "/" and it will work. --[[Joey]]
108 ----
110 I'd like to create a collapsable tree with a map, eg
112 * top level item
114 * * second level item1
116 * * * content 1
118 * * * content 2
120 * * * content 3
122 * * second level item2
124 * * second level item3
127 but I can't work out how to specify "all items at this level, and all directories at ../ and all the other directories to the root
129 any ideas?
131 > I don't think pagespecs currently support that. How would such a made-up
132 > pagespec look? I can imagine it supporting something like `glob(../*) and not
133 > glob(../*/*)` to match all "directories" of the parent page, and so on up
134 > to the root. --[[Joey]] 
136 >> I don't know, perhaps some way of nesting pagespecs 
137 >>> glob(../* unless $_ eq 'second level item'{ glob 'second level item'/*}) 
139 >> but that could get messy, perhaps a new cmd 'pagetree' or something 
140 >> might be better? --Colin
142 >>> You could probably do a lot worse than stealing terminology from 
143 >>> [XPath Axes](http://www.w3.org/TR/xpath/#axes),
144 >>> passing the "argument" through `bestlink` if there is one, and
145 >>> treating an empty argument as "this page", something like:
146 >>>
147 >>> * `ancestor(/plugins/contrib/album)` matches `plugins` or
148 >>>   `plugins/contrib`
149 >>>   but not `plugins/map` or `plugins/contrib/album`
150 >>>   (does it match `index`? answers on a postcard)
151 >>> * `descendant(/plugins)` is basically `plugins/*`
152 >>> * `child(/plugins)` is basically `plugins/* and !plugins/*/*`
153 >>> * `self(/plugins)` is just `plugins` but without interpreting
154 >>>   globs
155 >>> * `ancestor-or-self(/plugins)`, `descendant-or-self(/plugins)`
156 >>>   are syntactic sugar for e.g. `ancestor(/plugins) or self(/plugins)`
157 >>> * `self()` always matches the current page (not destpage)
158 >>> * `ancestor-or-self()` always matches the current pages and all
159 >>>   pages that would go in its [[plugins/parentlinks]]
160 >>>
161 >>> XPath has `following-sibling` and `preceding-sibling` axes for
162 >>> siblings, but pagespecs are unordered, so we'd probably want
163 >>> to invent `sibling()` - so `sibling(/plugins/map)` matches
164 >>> `plugins/inline` but not `plugins/map` or `plugins/contrib/album`.
165 >>>
166 >>> Then, the requested functionality would be `sibling() or ancestor()`,
167 >>> or possibly `sibling() or ancestor() or self()`?
168 >>> --[[smcv]]
170 >>>> I like that idea! --[[KathrynAndersen]]