I'm working on a site for a local organization. I'd like to be able to link directly to a contact form in Formicula, with that person defaulted as the contact, preferably with no option to choose a different concact. Basically, like a mailto link, but instead of launching an e-mail app, go to a contact form that will go to the person in question.
I'm pretty sure how to modify the form, just a matter of wheter or not the id can be sent to Formicula via the link?
--
Home Page | Find on Facebook | Follow on Twitter
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Link to Specific Contact in Formicula?
-
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
-
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
The cid can be set on the form, I have skipped the contact id choice most of the time, since it is fixed for a certain form. The formicaul code suggest, you can just make a link with cid=1 in the parameter list. The main function of Formicula checks for the cid, the form and you can even add extra info with the addinfo variable.
Code
$form = (int)FormUtil::getPassedValue('form', (isset($args['form'])) ? $args['form'] : $default_form, 'GETPOST');
$cid = (int)FormUtil::getPassedValue('cid', (isset($args['cid'])) ? $args['cid'] : -1, 'GETPOST');
// get subitted information - will be passed to the template
// addinfo is an array:
// addinfo[name1] = value1
// addinfo[name2] = value2
$addinfo = FormUtil::getPassedValue('addinfo', (isset($args['addinfo'])) ? $args['addinfo'] : array(), 'GETPOST');
--
campertoday.nl, Module development, Dutch Zikula Community -
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
Okay, I think I have it working, other than if it fails, then it losses the set CID.
edited by: HalbrookTech, datetimebrief
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
You could put some part in the form that checks for the $cid to be present and then sets this as a hidden form field (cid=$cid so to speak). THen you will not loose it when submitted as fail. But not sure if that works, just an idea.
--
campertoday.nl, Module development, Dutch Zikula Community -
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
Yeah, been a while since I played with forms and such in a PHP app, so I can probably figure it out, when I'm not worn out. I'll leave it as it is for now and work on a more practical solution as I go :) At least I can default the option, which is good. I may look in to implementing LivePipe in to the form. tho it probably will require mods to the actual code to make that useful.
edited by: HalbrookTech, datetimebrief
--
Home Page | Find on Facebook | Follow on Twitter
- Moderated by:
- Support
