Fork me on GitHub

Link to Specific Contact in Formicula?  Bottom

  • 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
  • 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
  • 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
  • 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
  • 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

This list is based on users active over the last 60 minutes.