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

John Rankin john.rankin at affinity.co.nz
Thu Jul 26 21:08:13 CDT 2007


On Thursday, 26 July 2007 6:32 PM, Sameer Kumar <skumar at eharch.com> wrote:
>>
<snip>
>
>[SK] When I use the ViewTemplate, to fill in the variables, I
>use the <detail> markup which automatically reads from the
>:term:definition markup. When I use the same table in the
>GroupHeader page, it does not fill in/resolve the <detail> tags .
>[SK] 

This is by design -- the ViewTemplate reinterprets the
content of the page; the GroupHeader is not part of the page.
In the same way, when you edit a page, you edit the content
of the page, not the page plus the GroupHeader.

>>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
>
><snip>
>
>[SK] I would surely like to follow this approach... I will be
>grateful if you could please help me out with this. Please bear
>in mind that I am not a programmer and have negligible
>experience with PHP. But I follow instructions quite well.
>[SK] 

Let me start by using the base wikiforms approach, ie without
the title option. The title adds a lot of complexity and
perhaps could be considered for a subsequent refined version. 
Getting titles straight in this case makes my head hurt.

With numbered pages (formtitle disabled)...
===========================================

1. set up 2 groups: eg FormData and FlexiData

FormData is driven by FormData.FormTemplate and FlexiData
is plain old wiki pages.

2. Set up FormData.GroupFooter with

(:if exists FlexiData.{$Name} :)(:include FlexiData.{$Name}:)
(:else:)[[FlexiData.{$Name} |Create flexi-text]] (:ifend:)

This will append the unstructured data if the page exists,
otherwise it will give you a link to create it.

3. Set up FlexiData.GroupFooter with

(:if exists FormData.{$Name} :)[[FormData.{$Name} |Return to form-text]]
(:ifend:)

4. In this scenario, your discussion tab should work

All the names are as pmwiki intended, and everything should
just work, including backlinks.

With titled pages (formtitle enabled)...
========================================

5. Tell FlexiData.GroupFooter what title to use

Change the (:if:) to read:
(:if exists FormData.{$Name} :)(:fpara xxxx=FormData.{$Name} :)
(:ifend:)

where xxxx is the name of the field designated as type 'title'

I *think* that will work. It might not.

6. Teach Comments pages the title as well

If 5 works, for the backlink, use

[[(:fpara xxxx={$BaseName} :)]]

I haven't tested this :-(
>
>> 
>>Looking forward to more ideas! I truly appreciate all your help.
>> 
>>-----Original Message-----
>> <snip>
>
>
>[SK] I am running into another problem owing to the formtitle
>recipe... I have just posted a question on the
>http://www.pmwiki.org/wiki/Cookbook/CommentPageLink-Talk at the
>very bottom. My "Discussion Tab" does not work as expected
>because the Page.Name is not the same as the Page.Title. Any ideas on that front??
>[SK]

See above. Try to get it working with pure {$Name} links
first, and add the title wrinkle afterwards. You want to
create pages named Comments.Projects-00001 with backlinks
to Projects.00001. $Title is transient; $Name is forever.


-- 
JR
--
John Rankin

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






More information about the pmwiki-users mailing list