X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/6848a2e8821ca4e7621545cf2c8d4d21be5e4d4c..68717497d3eb7a024ea0f48b60ddae98caccd81b:/doc/ikiwiki/directive/inline/discussion.mdwn?ds=inline diff --git a/doc/ikiwiki/directive/inline/discussion.mdwn b/doc/ikiwiki/directive/inline/discussion.mdwn index 9de80bf3e..5489d5f16 100644 --- a/doc/ikiwiki/directive/inline/discussion.mdwn +++ b/doc/ikiwiki/directive/inline/discussion.mdwn @@ -1,3 +1,10 @@ +## Combine inline and toggle + +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. + +-- Thiana + +--- ## How do you provide the per post discussion links in your own blog? > That's configured by the "actions" parameter to the inline directive. See @@ -11,7 +18,7 @@ take it as far as implementing "replies" to other comments. -- Marcelo -> See [[todo/discussion_page_as_blog]] for some of my own thoughts on this +> See [[plugins/comments]] > --[[Joey]] --- @@ -37,6 +44,120 @@ Is there a simple way to exclude images, stylesheets, and other I would be especially interested in a list of variables which can be used in such a template. -I have a page template with some structured information as parameters. For example `location="nowhere"` and `price="20"`. Is there a possibility to extract those information, i. e. access the parameters, to compose the item for the inline directive from these information? For example the line »Go to nowhere for 20 bugs.« is shown inlined. +> I try to keep ikiwiki's templates self-documenting, so if you take +> a look at a template used by inline, such as the default `/usr/share/ikiwiki/template/inlinepage.tmpl`, +> you can see all or nearly all the template variables in use in it. + +I have a page template with some structured information as parameters. For +example `location="nowhere"` and `price="20"`. Is there a possibility to +extract those information, i. e. access the parameters, to compose the item +for the inline directive from these information? For example the line »Go +to nowhere for 20 bugs.« is shown inlined. --[[PaulePanter]] + +> Let's not confuse the template directive with the templates used by inline. +> When a page is inlined, any template directives in it are first expanded, +> using the user-defined templates for that. Then, the inline directive's +> template is used to insert it into the inlining page. +> +> So no, you can't reference template directive parameters inside inline's +> template, because it's already expanded at that point. --[[Joey]] + +>> Thank you for the explanation. Can you think of another way to accomplish +>> my goals? +>> +>> Right now, I only see the option to edit the title with the +>> `[[/ikiwiki/directive/meta]]` directive and the field `title`. +>> +>> How could a solution look like? +>> +>> 1. The possibility to add custom fields to the `meta` directive. +>> 1. The possibility to specify in a page, how the page should be displayed +>> when used by inlined. That could be done by a new directive `cinlined` +>> (for »custom inlined«) which is chosen by the `inline` directive to +>> display if told to do so. +>> +>> [[!cinlined text="""Text which can also use Parameter, bla blubb â¦"""]] +>> --[[PaulePanter]] +>>> You can make the body of a page change depending on whether it's being +>>> inlined, with the [[ikiwiki/directive/if]] directive from the +>>> [[plugins/conditional]] plugin: +>>> +>>> \[[!if test="inlined()" +>>> then="""[[!template id=productsummary +>>> location="Warehouse 23" price=20 +>>> ]]""" +>>> else="""[[!template id=productdetail +>>> location="Warehouse 23" price=20 +>>> description="Every home should have one" +>>> ]]""" +>>> ]] +>>> +>>> Perhaps that does some of what you want? +>>> +>>> If you want to go beyond that, my inclination would be to write +>>> a simple plugin to deal with whatever it is you want to do (bug +>>> metadata or product metadata or whatever) rather than prematurely +>>> generalizing. --[[smcv]] + +## meta parameters are not enough + +I think I have the same problem as Paule, as I want extra arbitary parameters in my template. + +This is what I am doing currently, which makes my skin crawl. In `wgts/foo.mdwn` +I have resorted to using AUTHORURL as the location of this widgets icon: + + [[!meta authorurl="/ico/aHR0cDovL2JvbmRpLm9tdHAub3JnL3dpZGdldHMvYmF0dGVyeQ==.png" ]] + +In templates I have a file called `wgtlist.tmpl`: + +
+ +My index page has: + + [[!inline pages="./wgts/*" show=5 feeds=no actions=no rootpage="wgts" archive="yes" template=wgtlist]] + +Else can you please suggest a smarter way of getting certain data out from pages for a inline index? + +--[[hendry]] + +## A different idea: smuggling hook routines in through %params. + +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. + +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. + +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... + +--[[JasonRiedy]] + +--- + +## Interaction of `show` and `feedshow` + +Reading the documentation I would think that `feedshow` does not +influence `show`. + + \[[!inline pages="./blog/*" archive=yes quick=yes feedshow=10 sort=title reverse=yes]] + +Only ten pages are listed in this example although `archive` is set to +yes. Removing `feedshow=10` all matching pages are shown. + +Is that behaviour intended? + +> Is something going wrong because `quick="yes"` [[»turns off generation of any feeds«|inline]]? --[[PaulePanter]] + +--[[PaulePanter]] + +>> Bug was that if feedshow was specified without show it limited to it incorrectly. Fixed. --[[Joey]]