aboutsummaryrefslogtreecommitdiff
path: root/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn
blob: 69169400968b8b6f4f45847c4ac5871f38fe9146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
I recently created a page which shows only discussion pages which have recently been updated (sort of a discussion blog), eg.

<http://adam.shand.net/iki/comments/>

My thought was that this would be a good way to keep track of recent comments other then using the recent changes functionality.  It works well except that the title of the discussion pages all show up as "discussion" so it's not visibly obvious which page they are discussing.

One solution would be to change the inline plugin to support an argument which caused the full path of the page to be listed as the title.  So rather then the title of discussion page being listed as "discussion" it would show up as "2007/OpenDNS/discussion/".

The only other way I can think of making this work would be to set the title of the discussion pages using the meta plugin ... but I don't like my chances of getting visitors to do that consistantly. :-(

Cheers,
[[AdamShand]]

> One way to approach it would be to add a field to the template
> that contains the full page name. Then you just use a modified
> `inlinepage.tmpl`, that uses that instead of the title. --[[Joey]]

	diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
	index 59eabb6..82913ba 100644
	--- a/IkiWiki/Plugin/inline.pm
	+++ b/IkiWiki/Plugin/inline.pm
	@@ -229,6 +229,7 @@ sub preprocess_inline (@) {
	 					$template->param(content => $content);
	 				}
	 				$template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
	+				$template->param(page => $page);
	 				$template->param(title => pagetitle(basename($page)));
	 				$template->param(ctime => displaytime($pagectime{$page}, $params{timeformat}));

Cool, I'll give it a try, thanks! -- [[AdamShand]]