]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/inline/discussion.mdwn
Update on interaction between `show`, `feedshow` and `quick`.
[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 >> Thank you for the explanation. Can you think of another way to accomplish
61 >> my goals?
62 >>
63 >> Right now, I only see the option to edit the title with the
64 >> `[[/ikiwiki/directive/meta]]` directive and the field `title`.
65 >>
66 >> How could a solution look like?
67 >>
68 >> 1. The possibility to add custom fields to the `meta` directive.
69 >> 1. The possibility to specify in a page, how the page should be displayed
70 >>    when used by inlined. That could be done by a new directive `cinlined`
71 >>    (for »custom inlined«) which is chosen by the `inline` directive to
72 >>    display if told to do so.
73 >>
74 >>    [[!cinlined text="""Text which can also use Parameter, bla blubb …"""]]
75 >> --[[PaulePanter]]
76 >>> You can make the body of a page change depending on whether it's being
77 >>> inlined, with the [[ikiwiki/directive/if]] directive from the
78 >>> [[plugins/conditional]] plugin:
79 >>>
80 >>>     \[[!if test="inlined()"
81 >>>       then="""[[!template id=productsummary
82 >>>         location="Warehouse 23" price=20
83 >>>         ]]"""
84 >>>       else="""[[!template id=productdetail
85 >>>         location="Warehouse 23" price=20
86 >>>         description="Every home should have one"
87 >>>         ]]"""
88 >>>     ]]
89 >>>
90 >>> Perhaps that does some of what you want?
91 >>>
92 >>> If you want to go beyond that, my inclination would be to write
93 >>> a simple plugin to deal with whatever it is you want to do (bug
94 >>> metadata or product metadata or whatever) rather than prematurely
95 >>> generalizing. --[[smcv]]
96
97 ## meta parameters are not enough
98
99 I think I have the same problem as Paule, as I want extra arbitary parameters in my template.
100
101 This is what I am doing currently, which makes my skin crawl. In `wgts/foo.mdwn`
102 I have resorted to using AUTHORURL as the location of this widgets icon:
103
104         [[!meta authorurl="/ico/aHR0cDovL2JvbmRpLm9tdHAub3JnL3dpZGdldHMvYmF0dGVyeQ==.png" ]]
105
106 In templates I have a file called `wgtlist.tmpl`:
107
108         <div class="widget">
109         <TMPL_IF NAME="AUTHORURL">
110         <img src="<TMPL_VAR AUTHORURL>" />
111         </TMPL_IF>
112         <TMPL_IF NAME="PERMALINK">
113         <a href="<TMPL_VAR PERMALINK>"><TMPL_VAR TITLE></a><br />
114         <TMPL_ELSE>
115         <a href="<TMPL_VAR PAGEURL>"><TMPL_VAR TITLE></a><br />
116         </TMPL_IF>
117         Posted <TMPL_VAR CTIME>
118         </div>
119
120 My index page has:
121
122         [[!inline pages="./wgts/*" show=5 feeds=no actions=no rootpage="wgts" archive="yes" template=wgtlist]]
123
124 Else can you please suggest a smarter way of getting certain data out from pages for a inline index?
125
126 --[[hendry]]
127
128 ---
129
130 ## Interaction of `show` and `feedshow`
131
132 Reading the documentation I would think that `feedshow` does not
133 influence `show`.
134
135          [[!inline pages="./blog/*" archive=yes quick=yes feedshow=10 sort=title reverse=yes]]
136
137 > Somehow the line above is not displayed correctly.
138
139 Only ten pages are listed in this example although `archive` is set to
140 yes. Removing `feedshow=10` all matching pages are shown.
141
142 Is that behaviour intended?
143
144 > Is something going wrong because `quick="yes"` [[»turns off generation of any feeds«|inline]]? --[[PaulePanter]]
145
146 --[[PaulePanter]]