]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/inline/discussion.mdwn
Change Projects link to point to projects DB
[ikiwiki.git] / doc / ikiwiki / directive / inline / discussion.mdwn
1 ## Combine inline and toggle
2
3 Is it possible to combine the behaviour of toggle and inline? ie, have it present of list of 'headlines' which are created from seperate subpages which can be clicked to expand to the body of the inlined page. Thanks.
4
5 -- Thiana
6
7 ---
8 ## How do you provide the per post discussion links in your own blog?
9
10 > That's configured by the "actions" parameter to the inline directive. See
11 > docs in [[plugins/inline]]. --[[Joey]]
12
13 And do you have any ideas/hints about implementing a "comments" feature.
14 What I'm after is something for users who don't quite understand the Wiki
15 style for discussions.  I would like to have a form for them to post a
16 comment and have the comment appended to the discussion Wiki-style.  Maybe
17 take it as far as implementing "replies" to other comments.
18
19 -- Marcelo
20
21 > See [[plugins/comments]]
22 > --[[Joey]]
23
24 ---
25
26 ## More dynamic `rootpage` parameter of inline plugin?
27
28 (Moved to [[todo/dynamic_rootpage]])
29
30 ---
31
32 ## Excluding Images
33
34 Is there a simple way to exclude images, stylesheets, and other
35 "non-page" files other than a blacklist approach like
36 `pages="* and !*.png and !*.css"`?  --[[JasonBlevins]]
37
38 > The [[plugins/filecheck]] plugin adds a 'ispage()' pagespec test that can do that.
39 > --[[Joey]]
40
41 ---
42
43 ## Documentation for parameter `template`?
44
45 I would be especially interested in a list of variables which can be used in such a template.
46
47 > I try to keep ikiwiki's templates self-documenting, so if you take
48 > a look at a template used by inline, such as the default `/usr/share/ikiwiki/template/inlinepage.tmpl`,
49 > you can see all or nearly all the template variables in use in it.
50
51 I have a page template with some structured information as parameters. For
52 example `location="nowhere"` and `price="20"`. Is there a possibility to
53 extract those information, i. e. access the parameters, to compose the item
54 for the inline directive from these information? For example the line »Go
55 to nowhere for 20 bugs.« is shown inlined.
56
57 --[[PaulePanter]]
58
59 > Let's not confuse the template directive with the templates used by inline.
60 > When a page is inlined, any template directives in it are first expanded,
61 > using the user-defined templates for that. Then, the inline directive's
62 > template is used to insert it into the inlining page.
63
64 > So no, you can't reference template directive parameters inside inline's
65 > template, because it's already expanded at that point. --[[Joey]] 
66
67 >> Thank you for the explanation. Can you think of another way to accomplish
68 >> my goals?
69 >>
70 >> Right now, I only see the option to edit the title with the
71 >> `[[/ikiwiki/directive/meta]]` directive and the field `title`.
72 >>
73 >> How could a solution look like?
74 >>
75 >> 1. The possibility to add custom fields to the `meta` directive.
76 >> 1. The possibility to specify in a page, how the page should be displayed
77 >>    when used by inlined. That could be done by a new directive `cinlined`
78 >>    (for »custom inlined«) which is chosen by the `inline` directive to
79 >>    display if told to do so.
80 >>
81 >>    [[!cinlined text="""Text which can also use Parameter, bla blubb …"""]]
82 >> --[[PaulePanter]]
83 >>> You can make the body of a page change depending on whether it's being
84 >>> inlined, with the [[ikiwiki/directive/if]] directive from the
85 >>> [[plugins/conditional]] plugin:
86 >>>
87 >>>     \[[!if test="inlined()"
88 >>>       then="""[[!template id=productsummary
89 >>>         location="Warehouse 23" price=20
90 >>>         ]]"""
91 >>>       else="""[[!template id=productdetail
92 >>>         location="Warehouse 23" price=20
93 >>>         description="Every home should have one"
94 >>>         ]]"""
95 >>>     ]]
96 >>>
97 >>> Perhaps that does some of what you want?
98 >>>
99 >>> If you want to go beyond that, my inclination would be to write
100 >>> a simple plugin to deal with whatever it is you want to do (bug
101 >>> metadata or product metadata or whatever) rather than prematurely
102 >>> generalizing. --[[smcv]]
103
104 ## meta parameters are not enough
105
106 I think I have the same problem as Paule, as I want extra arbitary parameters in my template.
107
108 This is what I am doing currently, which makes my skin crawl. In `wgts/foo.mdwn`
109 I have resorted to using AUTHORURL as the location of this widgets icon:
110
111         [[!meta authorurl="/ico/aHR0cDovL2JvbmRpLm9tdHAub3JnL3dpZGdldHMvYmF0dGVyeQ==.png" ]]
112
113 In templates I have a file called `wgtlist.tmpl`:
114
115         <div class="widget">
116         <TMPL_IF NAME="AUTHORURL">
117         <img src="<TMPL_VAR AUTHORURL>" />
118         </TMPL_IF>
119         <TMPL_IF NAME="PERMALINK">
120         <a href="<TMPL_VAR PERMALINK>"><TMPL_VAR TITLE></a><br />
121         <TMPL_ELSE>
122         <a href="<TMPL_VAR PAGEURL>"><TMPL_VAR TITLE></a><br />
123         </TMPL_IF>
124         Posted <TMPL_VAR CTIME>
125         </div>
126
127 My index page has:
128
129         [[!inline pages="./wgts/*" show=5 feeds=no actions=no rootpage="wgts" archive="yes" template=wgtlist]]
130
131 Else can you please suggest a smarter way of getting certain data out from pages for a inline index?
132
133 --[[hendry]]
134
135 ## A different idea: smuggling hook routines in through %params.
136
137 The part that fetches the inlined content is quite compact. It's just the if ($needcontent) {} chunk. Would a patch that accepts a perl sub smuggled through something like $params{inliner_} be accepted? If that param exists, call it instead of the current content of that chunk. Pass $page, %params, and $template. Receive $content, possibly seeing $template modified. The custom directives can add inliner_ to %params and call IkiWiki::preprocess_inline. I suppose IkiWiki::Plugin::inline could be modified to strip any *_ out of the directive's arguments to prevent any custom behavior from leaking into the inline directive.
138
139 I'm about to try this for a CV/resume type of thing. I want only one element with a specific id out of the generated content (with a little post-processing). I don't need performance for my case.
140
141 Update: Pretty much works. I need a way to skip sources, but inline shrinks the list of all pages *before* trying to form them. Next little bit...
142
143 --[[JasonRiedy]]
144
145 ---
146
147 ## Interaction of `show` and `feedshow`
148
149 Reading the documentation I would think that `feedshow` does not
150 influence `show`.
151
152         \[[!inline pages="./blog/*" archive=yes quick=yes feedshow=10 sort=title reverse=yes]]
153
154 Only ten pages are listed in this example although `archive` is set to
155 yes. Removing `feedshow=10` all matching pages are shown.
156
157 Is that behaviour intended?
158
159 > Is something going wrong because `quick="yes"` [[»turns off generation of any feeds«|inline]]? --[[PaulePanter]]
160
161 --[[PaulePanter]]
162
163 >> Bug was that if feedshow was specified without show it limited to it incorrectly. Fixed. --[[Joey]]