X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/716b0486f4d5b9b60103f2cbca059aa198640f88..2fc21bff0adc27d9374aa6b5f5011ca422df47d8:/doc/templates/discussion.mdwn diff --git a/doc/templates/discussion.mdwn b/doc/templates/discussion.mdwn index 33e187e2c..030a842cd 100644 --- a/doc/templates/discussion.mdwn +++ b/doc/templates/discussion.mdwn @@ -1,14 +1,67 @@ -I was wondering what the best way to customise the templates is. +This confuses me enormously. Perhaps because I am new to ikiwiki, to perl, to Linux, etc. -Would it be best to copy them all into the wiki under version control or have them seperate? +note and popups are templates? But they're not in the templates directory, and in my readings here, templates are supposed to be in the ../templates directory. -Thanks +> Ikiwiki has an basewiki underlay that provides wiki files not included in +> your personal wiki sources. The note and popup template pages are +> installed there, typically in `/usr/share/ikiwiki/basewiki/templates/` +> --[[Joey]] -john +> > And how am I able to use e.g. links? It's not listed in `/usr/share/ikiwiki/basewiki/templates`. +> > I intend do (mis)use links for a horizontal navigation. Or may I be better off altering page.tmpl? +> > --z3ttacht -> Either way would work ok. From a security standpoint, keeping the templates under version control isn't entirely safe, if you have anonymous untrusted svn committers. Web commits won't be able to touch them though, so that's ok. --[[Joey]] +---- +Is there a list of the TMPL_VAR-Variables that are defined by ikiwiki? -Couldn't the [[templates/plugin]] template replace the "included" parameter -with the same check used for "third-party plugin"? Don't "third-party plugin" -and "included in ikiwiki" form precisely complementary sets? --[[JoshTriplett]] +What I'm trying to achieve is to print the URL of every page on the page itself and therefore I would need the corresponding value in the Template. + +Am I missing something? --[[jwalzer]] + +> If there isn't a suitable variable (I don't think there is a list at +> the moment), a [[plugin|plugins/write]] to add one would be about 10 +> lines of perl - you'd just need to define a `pagetemplate` hook. --[[smcv]] + +---- + +Is there a list of all the available variables somewhere, or do I just grep the source for TMPL_VAR? And is there a way to refer to a variable inside of a wiki page or does it have to be done from a template? Thanks. -- [[AdamShand]] + +I pulled a list of variables and posted it, its in the history for [[templates]] under my name. [[justint]] + +---- + +I am trying to override `page.tmpl` by providing `templates/page.tmpl` in my `srcdir`- this works, but now `templates/page.tmpl` is created in my `destdir` as well! Is this expected? --chenz + +> Yes. Every file found in the wiki is treated as either a page (passed through the whole +> rendering pipeline to HTML) or an attachment (copied as-is). --[[smcv]] + +Is there a way to avoid this? --chenz + +> With the page in your wiki's git repository: not currently. +> You can define a `templatedir` in your setup file and put your overridden page.tmpl +> there instead. --s + +---- + +I'm seeing some curious behaviour with `$srcdir/templates/` templates not being found when +pushing from a remote computer. Touching the relevant file on the server and +`ikiwiki --setup wiki.setup --refresh -v` sorts it out. I have done `--refresh +--wrappers` just to be sure the hooks aren't out of date. Anyone knows what +might be causing this? I'm running a custom branch of ikiwiki master from a +couple of weeks ago so could be my own doing but my changes are mainly to the +album and img plugins. --[[kjs]] + +> Seems like the issue is rather that the templates aren't found/triggered +> when the page render is set off by dependencies rather than direct editing +> of the page. Not the remove local issue mentioned above. --[[kjs]] + +>> Thanks, that was the hint I needed to be able to reproduce this bug. It seems +>> to have been caused by an optimization: please try applying +>> [commit 5fd863b5](http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=5fd863b5b05449669ec56c6798d836e3302386e2) +>> to your Render.pm. A follow-up commit partially restores the optimization, +>> only for rebuilds. --[[smcv]] + +>>> I've applied both your patches and as far as I can tell it's now working +>>> as expected. Templates get rendered even if rebuild is triggered by +>>> comments on another page. --[[kjs]]