[dokuwiki] Re: How to embed an external picture
- From: Christopher Smith <chris@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Sun, 18 Jan 2009 08:10:53 +0900
On 18 Jan 2009, at 07:28, Werner Flamme wrote:
Hi everyone,
I want the daily cartoon of userfriendly.org on one of my wiki pages.
Since there is a new URL every day, I try to do this through a syntax
plugin.
The plugin works fine so far - when doing the preview, I see the
cartoon
where it should be. As soon as I press "Save", the page is rendered
anew
and contains PHP source code instead of the text (and cartoon) I
entered.
<snip>
...and the whole code of this file, ending with '?>' The rest of the
page (text, footer) is not shown. As I said, in the preview everything
is fine. What am I doing wrong?
Its difficult to tell from the information you have provided. My
first guess is you need to start PHP code with "<?php", however that
would also mean it couldn't have worked in preview. You say it did, so
that is out then.
Do I have to add a method getAllowedTypes()? What had to be the return
value? array('externallink')? And then just adding
'[[http://www.userfriendly.org/cartoons/archives/09jan/
xuf012317.gif]]'
instead of the code above to $renderer->doc?
This is documented at devel:syntax_plugins. I strongly suggest you
read that page, including the section at the bottom on creating your
own plugin.
For your plugin, follow the first example, "now". For your output
"date('Ymd')" will generate the changing part of the URL. You'll need
to turn caching off - or research an action component to ensure the
cached version is expired at midnight every day.
- Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
Other related posts: