|
Cookbook /
FoxContactsSummary: Create personal or business Contacts pages and lists with Fox
Version: 2010-03-17
Status: new
Maintainer: HansB
Download: foxcontacts.zipΔ
DescriptionAn application using Fox to create and maintain pages in a Contacts group, which store contact information in form of PTVs (Page Text Variables). Copy the page files from foxcontacts.zipΔ into your wiki.d/ folder, and the Contacts.php file into your local/folder. Install Fox, FoxEdit and FoxDelete if you have not done already. This will create a group named Contacts, with the following pages:
New contacts are created as new pages in the group, and listed on the index page. Optional add a pagelist for the sidebar or rightbar to list all contacts: *[[NewContact]]
!!!!Contacts:
(:pagelist group={*$Group} list=normal fmt=#title name=-*Template,-*Contact* :)
With custom display templates one could display for instance telephone numbers or email address next to the name. Example, using simple table markup:
(:pagelist group={$Group} list=normal fmt=#customlist name=-*Contact*:)
(:if false:)
[[#customlist]]
(:template first:)
||
||!Name ||!Phone ||!Email ||
(:template each:)
||[[{=$FullName}|+]] ||{{=$FullName}$:telephone} ||{{=$FullName}$:email} ||
[[#customlistend]]
(:ifend:)
Or other index pages could be added with special listings of selected contact details. Live example: FoxContacts NotesThe NewContact form acts in two ways:
These two very different functions are combined in one form, and that needs some specific syntax constructions. The fox template '#new' on the ContactTemplates page is used to add PTVs and also a lengthy So what is the purpose of Now if we look at the #display template section, we find there among much else a foxedit link markup and 'deletelink', which refers to a foxdelrange markup inside the Finally in this very brief explanation we can see that each Contact page has also a Comment form at the bottom, for easy adding multiple comments. This is just a basic Fox comment form, and an add-on to the functionality, which could be stripped. Release Notes
CommentsNeat. Any thoughts on how to get a vcard?
Also, suppose I added a "birthday" field. Any idea how that could be integrated with
one of the calendars, say PmCalendar? (I'd hesitate to simply add a name to a date
page, as we might have to correct birthdates later. I also wouldn't want to make a
calendar loop over every contact page for every date.) -- rlt
Very flexible and useful. However, the delete function only deletes the content lines but not the contact. Therefore, pagelist still thinks the contact exists and will list deleted contacts in the contact list. To actually delete a contact, the content should, in this case, be replaced with 'delete'. How do I do that? -- jhj
Set in alocal config for your contacts group (for instance in local/Contacts.php);
$DeleteKeyPattern = "^\\s*$";
Now a page will be deleted if it is empty. So the fox deleterange link or button will erase the page as well. HansB
PKHG speaking: Hans (reply by e-mail?), if you specify the layout of a birthday, I could adjust the GcalPmWiki to allow
Birthday-Groups (as you use it here for Contacts) to scan all "BirthdayGroup".* files for birthdays (only the first one? or several?) or a Birthday-only-Kalendar Hans: The edit screen (form=FoxEditContact)on your demo website is missing the captcha. Attempts to edit and existing contact and then save trigger the messgae "ERROR: Missing or wrong Captcha Code!" Pico November 20, 2007, at 03:50 PM
Thanks for catching that! I fixed it now on my site. I left out captcha or access code from the recipe here, as I think that will in any case have a Contacts group under lock, either with edit or with read access restricted. HansB November 20, 2007, at 04:17 PM
I have just tried to install FoxContacts and I am getting the following error when I select the edit a contact link:
I also found that I needed to install foxdelete.php to make the delete links work which was not documented (is that correct). I have searched for this error message but I can't figure out what I have done wrong, I have not edited the pages or anything they are just how I downloaded them and I have saved all the files to default directories. Any help much appreciated - Neal : April 21, 2008 Thank you for pointing this out! There seems to be a bug in the latest FoxEdit regards the form check. Till this is sorted please set in config.php This bug is now fixed in FoxEdit - HansB April 21, 2008, at 05:17 AM Thank you - Neal Hi Hans - nice recipe. If I want to add a field do I add it to ContactTemplates and any existing contacts? Thanks Matt May 4, 2010 Yes, but you also need the extra input field in the form in page NewContact. - HansB May 05, 2010, at 11:59 AM Hi Hans, Fantastic recipe and I'm looking forward to doing more with Fox. One question at this point, is there an easy way to establish multiple "Contact" groups within a single Wiki? I'm using pmwiki as an Intranet, and would like for individual groups in my organization to have their own contact directory. The files in the zip are for setting up a Contacts group. But you can rename them for setting up the contact form etc. for different groups. Basically all is self-contained in one group, so several differently named contacts groups will work. One could of course put the ContactsTemplates page into the Site group to have just one page for the templates. Then the NewContacts form need adjusting to use its template from there, and the templates themselves need some adjusting to use Site.ContactsTemplates rather than just ContactsTemplates. - HansB May 05, 2010, at 05:24 PM Hi Hans, really am starting to love Fox, incredibly useful tool for use with PMwiki. I'm a noobie when it comes to working on this stuff, but persistant, and have been able to puzzle my way through things, with the help of Google. Now, my question about Fox Contacts, you mentioned that with custom display templates you could add email or phone to the pagelist. Well, I've read everything that I could on templates and PTV and hunted the internet, but have come up dry. I can't believe that someone hasn't wanted to do the same thing with FoxContacts, but I can't seem to find anything. Do you have an example of how I could add a field from a FoxContact to a PageList? If I can see one example, I'm sure I'll be able to build my own template sucessfully (as opposed to now, where I think I'm on version 10, with no success). Thanks!!! Sure! I added an example above for a custom pagelist template displaying title (Contact full name), telephone and email. The last two are PTVs, note the curly brackets inside curly brackets. See AlsoContributorsUser notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |