[pmwiki-users] Prepend text string to wiki file when saving - another approach?
josh at virtualmillers.net
Sun Sep 9 16:41:53 CDT 2007
I'm still trying to get this to work. Patrick provided me some useful
help but I couldn't get the implementation to work on my site.
How about a different approach:
Each time I save a wiki page to a file, I want to prepend a text string
to it. Then when I edit the file, I want to pull that text string out.
For example: let's prepend the following to every page at the beginning
of the text:
<div id="pre">Page updated by $author</div>
Except I want to store the value of the variable, not the variable so
when I save the page the text in the file in the wiki.d directory reads
like this test file:
text=<div id="pre">Page updated by Josh</div>%0a%0ahello there
Now, when Jim comes along and edits the page, it pulls the preceding
text out so the edit field looks like:
But when Jim saves, the text is changed to:
text=<div id="pre">Page updated by Jim</div>%0a%0ahello there people
This is just an example - I am not actually trying to prepend the author
information...I know there are better/other ways to do that.
I'm thinking of a function or functions that works similar to the
edittitle recipe that strips the (:title:) from the wiki text when you
edit and save.
I need to watch out for special conditions such as when that text string
Does this make any more sense?
Anyone have any ideas or some thoughts on a starting point?
You assistance is always appreciated!
More information about the pmwiki-users