[pmwiki-users] NEW RECIPE: EditMore...

Ben Wilson dausha at gmail.com
Sat Sep 1 14:33:13 CDT 2007


On 9/1/07, Mike Shanley <up at upisup.com> wrote:
> Ben Wilson wrote:
> > Why does it *have* to put the categories in a DIV?
> You are right about this: It doesn't have to put them /anywhere/, but it
> does have to put them /somewhere/. The reason is that when the next
> person comes around to edit, all of those categories have got to get
> back into that little input box... and OUT of the pagetext. Thus, there
> needs to be some special marker to indicate the start and end of this list.

Nope. You do not need a special marker, you need to decide how to
record the category. The PmWiki standard is [[!CategoryName]]. Thus,
to use that markup allows you to collect those categories. The regex
is "\[\[!(.*?)\]\]". So, when loading the page['text'] you have
something like (forgive the bad PHP, I've been writing Python lately,
and am in a hurry):

function grab_categories($m) {
  global $EditCategories
   $EditCategories[] = $m[0];
}
preg_function_callback(grab_categories, $page['text']);

Look at how the Footnotes recipe (have I published it?) works. If you
can't find it, email me off-list and I'll remedy.

We should take the rest of our conversation to pmwiki-dev or off list.
I'll write more later.

-- 
Ben Wilson
"Words are the only thing which will last forever" Churchill



More information about the pmwiki-users mailing list