templating question
[ikiwiki.git] / doc / ikiwiki / directive / inline / discussion.mdwn
1 ## How do you provide the per post discussion links in your own blog?
2
3 > That's configured by the "actions" parameter to the inline directive. See
4 > docs in [[plugins/inline]]. --[[Joey]]
5
6 And do you have any ideas/hints about implementing a "comments" feature.
7 What I'm after is something for users who don't quite understand the Wiki
8 style for discussions.  I would like to have a form for them to post a
9 comment and have the comment appended to the discussion Wiki-style.  Maybe
10 take it as far as implementing "replies" to other comments.
11
12 -- Marcelo
13
14 > See [[plugins/comments]]
15 > --[[Joey]]
16
17 ---
18
19 ## More dynamic `rootpage` parameter of inline plugin?
20
21 (Moved to [[todo/dynamic_rootpage]])
22
23 ---
24
25 ## Excluding Images
26
27 Is there a simple way to exclude images, stylesheets, and other
28 "non-page" files other than a blacklist approach like
29 `pages="* and !*.png and !*.css"`?  --[[JasonBlevins]]
30
31 > The [[plugins/filecheck]] plugin adds a 'ispage()' pagespec test that can do that.
32 > --[[Joey]]
33
34 ---
35
36 ## Documentation for parameter `template`?
37
38 I would be especially interested in a list of variables which can be used in such a template.
39
40 > I try to keep ikiwiki's templates self-documenting, so if you take
41 > a look at a template used by inline, such as the default `/usr/share/ikiwiki/template/inlinepage.tmpl`,
42 > you can see all or nearly all the template variables in use in it.
43
44 I have a page template with some structured information as parameters. For
45 example `location="nowhere"` and `price="20"`. Is there a possibility to
46 extract those information, i. e. access the parameters, to compose the item
47 for the inline directive from these information? For example the line »Go
48 to nowhere for 20 bugs.« is shown inlined.
49
50 --[[PaulePanter]]
51
52 > Let's not confuse the template directive with the templates used by inline.
53 > When a page is inlined, any template directives in it are first expanded,
54 > using the user-defined templates for that. Then, the inline directive's
55 > template is used to insert it into the inlining page.
56
57 > So no, you can't reference template directive parameters inside inline's
58 > template, because it's already expanded at that point. --[[Joey]] 
59
60 ## meta parameters are not enough
61
62 I think I have the same problem as Paule, as I want extra arbitary parameters in my template.
63
64 This is what I am doing currently, which makes my skin crawl. In `wgts/foo.mdwn`
65 I have resorted to using AUTHORURL as the location of this widgets icon:
66
67         [[!meta authorurl="/ico/aHR0cDovL2JvbmRpLm9tdHAub3JnL3dpZGdldHMvYmF0dGVyeQ==.png" ]]
68
69 In templates I have a file called `wgtlist.tmpl`:
70
71         <div class="widget">
72         <TMPL_IF NAME="AUTHORURL">
73         <img src="<TMPL_VAR AUTHORURL>" />
74         </TMPL_IF>
75         <TMPL_IF NAME="PERMALINK">
76         <a href="<TMPL_VAR PERMALINK>"><TMPL_VAR TITLE></a><br />
77         <TMPL_ELSE>
78         <a href="<TMPL_VAR PAGEURL>"><TMPL_VAR TITLE></a><br />
79         </TMPL_IF>
80         Posted <TMPL_VAR CTIME>
81         </div>
82
83 My index page has:
84
85         [[!inline pages="./wgts/*" show=5 feeds=no actions=no rootpage="wgts" archive="yes" template=wgtlist]]
86
87 Else can you please suggest a smarter way of getting certain data out from pages for a inline index?
88
89 --[[hendry]]