[pmwiki-users] Wikiforms and templates (Sameer Kumar):pmwiki-users Digest, Vol 25, Issue 59

John Rankin john.rankin at affinity.co.nz
Wed Jul 25 19:16:28 CDT 2007


On Thursday, 26 July 2007 11:06 AM, Sameer Kumar <skumar at eharch.com> wrote:
>
>Thanks for your word, John.
> 
>In my understanding, if I use a large text field, I then cannot
>apply standard wiki markup to format the text within the field.
>Is that correct? If so, that would be a major problem.

No, that is not correct. All regular wiki markup will work normally.
The only constraint is that the first line is treated as part of the
":term:definition" wiki syntax, so cannot start with line markup
like *#!. If the first line really, really has to be a heading or a
list item, we could probably figure out a way to do that, eg by
writing in the field:

%comment%Ignore this line%%

!!I want to start with a heading

> 
>I have two questions:
>1.     Other than ViewTemplate, is there another method that
>can make use of the :term:definition markup that the Wikiform
>creates? GroupHeader does not seem to work with it, for example.

Let me explain what wikiforms does. When you edit a page via the
page form, it bypasses the regular PmWiki HandleEdit function
to operate on the page contents via the FormTemplate. In the same
way, when you view a page through a ViewTemplate, it appllies
the template before giving the content to PmWiki's HandleBrowse
function. In both cases, the group header and footer pages are
wrapped around the page afterwards. 

The group headers and footers are not part of the page, so the
wikiform edit and view templates don't process them. The view
template uses the FormTemplate to take the page apart, so it
is not obvious how it could take account of what is in the
group header or footer.

When you say "GroupHeader does not seem to work with it"
could you explain what happens and what you would like to
happen?

>2.     Can the Wikiform data be saved on a separate
>Group.Page.table page which then is 56;(:include:)-ed57;  in
>the Group.Page? Would that also be complicated since I am also
>using the formtitle recipe to not have to live with the numbered titles?

Yes, I have done this when I wanted to have 2 forms for 2 different
parts of the page. The form title recipe adds a further complication,
of course, but I think there are a couple of options. The challenge
is making automatic links between the pages pairs.

1. form data in one group, normal wiki data in another group

2. form data and normal wiki data in the same group

In both cases, the general approach is the same: use the title
of the form-based pages as the name of the regular pages. That
way, you can automatically generate links between them.
I think on the whole that it will be easier to put the pages into
separate groups, because then you can use a GroupFooter to
specify the include.

I think you will need some extra code to generate the include,
to translate the name of the current page in the wiki-based
group into the number of the corresponding page in the form-based
group, and then to include it.

I hope that makes sense -- if you decide on this approach, let
me know and I'll try to spell it out in more detail. The short
answer is that it can be done.


> 
>Looking forward to more ideas! I truly appreciate all your help.
> 
>-----Original Message-----
> <snip>


-- 
JR
--
John Rankin

       \_      
        \)   
         \,\__/7
         /    /
        (   c'
         \  / 
     /,  /_/  
    |  & *   Wellington
    )  /    
   /  /,    
  /  (    
 |   /      
 \__/       
   V        






More information about the pmwiki-users mailing list