Fork me on GitHub

Send Form Data from Formicula to Pagesetter  Bottom

  • Per this conversation, I have been trying to get a Formicula form to send data to a Pagesetter publication. However, I am having a bit of trouble making this happen.


    When the form is filled out and submitted, Formicula throws an error, "An error has occurred." No other information is provided. Any help on this subject is greatly appreciated!


    Here is my 1_userconfirm.html code (Formicula form template):

    Code

    <!--[include file=1_userheader.html]-->

    <p >Thank you for submitting your ad.</p>
    <p>For confirmation purposes, here is the information you provided:</p>

    <table>
        <!--[foreach item=field from=$custom]-->
        <tr>
            <td class="sub"><!--[$field.name]--></td>
            <td><!--[$field.data]--></td>
        </tr>
        <!--[/foreach]-->
    </table>

    <!--[if $sendtouser==true]-->
    <!--[pnml name='_FOR_SENDTOUSER' html=1]-->
    <!--[else]-->
    <!--[pnml name='_FOR_ERRORSENDINGUSERMAIL' html=1]-->
    <!--[/if]-->

    <!--[php]-->
    $publication = array();
    $publication['core_author'] = $this->_tpl_vars['userdata']['uname'];
    $publication['core_creatorID'] = 2;
    $publication['core_creator'] = 'Admin';
    $publication['core_approvalState'] = 'approved';
    $publication['core_approvalTitle'] = '';
    $publication['core_topic'] = -1;
    $publication['core_showInList'] = 1;
    $publication['core_showInMenu'] = 1;
    $publication['core_online'] = 1;
    $publication['core_revision'] = 0;
    $publication['core_language'] = 'x_all';
    $publication['core_publishDate'] = '2006-09-06 17:26:29';
    $publication['core_expireDate'] = '';

    //here we have the most important things: publication fields
    $publication['title'] = $this->_tpl_vars['userdata']['title'];
    $publication['price'] = $this->_tpl_vars['userdata']['price'];
    $publication['location'] = $this->_tpl_vars['userdata']['location'];
    $publication['category'] = $this->_tpl_vars['userdata']['category'];
    $publication['description'] = $this->_tpl_vars['userdata']['description'];
    $publication['uemail'] = $this->_tpl_vars['userdata']['uemail'];
    $publication['showemail'] = $this->_tpl_vars['userdata']['showemail'];
    $publication['phoneac'] = $this->_tpl_vars['userdata']['phoneac'];
    $publication['phonepre'] = $this->_tpl_vars['userdata']['phonepre'];
    $publication['phonesuf'] = $this->_tpl_vars['userdata']['phonesuf'];
    $publication['showphone'] = $this->_tpl_vars['userdata']['showphone'];

    $this->_tpl_vars['pub'] = $publication;
    <!--[/php]-->

    <!--[pnmodapifunc modname="pagesetter" type="edit" func="createPub" tid="3" pubData=$pub]-->


    And here is a screenshot of the Pagesetter publication that I am trying to send the Formicula data to:



    You can see the form in action at http://dallas-oregon…le=formicula&form=1


    Thanks!!




    edited by: Wendell, Jun 28, 2007 - 08:34 AM
  • Wendell,

    Code

    $publication['showemail'] = $this->_tpl_vars['userdata']['showemail'];
    $publication['phoneac'] = $this->_tpl_vars['userdata']['phoneac'];
    $publication['phonepre'] = $this->_tpl_vars['userdata']['phonepre'];
    $publication['phonesuf'] = $this->_tpl_vars['userdata']['phonesuf'];


    Those are not 'userdata' constants, you'll have to define them hardcoded in Formicula too [I've done something similar on www.decabo.be]

    - Igor
  • Well I may just give up that thought then and go back to trying to customize the Pagesetter input forms. My biggest issue here with that is how the forms look... I want to make them match my site, but I don't know the first thing about customizing them and I have devoted a ton of time trying to make that happen. I can get some slight adjustments to the look, but I can't customize them like I can in Formicula.

    That said, anyone care to get paid to make my Pagesetter forms match the rest of my site? I'd much rather get the Pagesetter forms customized accordingly, but I went the Formicula route when I couldn't get the Pagesetter stuff to work. Let me know what you'd charge. I really need to get this working and need all the help I can get.

    Thanks,

    Wendell




    edited by: Wendell, Jun 27, 2007 - 10:29 AM
  • Wendell


    Here is my 1_userform.html code (Formicula form template):


    By the way, this code should be placed in your "1_userconfirm.html", I'm a bit swamped now, but I'll check out if anything can be done with the 'dynamic' fields...

    - Igor
  • Whoops, you're right, that is my 1_userconfirm.html template. Typo on my part. Corrected in the original post.
  • I remember this post...
    I needed a quick solution for my quiz... I have a quiz-full template in Pagesetter with a few questions and Publication field type.
    In short, answers filled out in pubType 4 are passed thru Formicula and saved in pubType 16 [the answers, user ID, core.creator and pubType4#core.pid]. I took me less then an hour to get it working.

    Code

    <!--[pnvarcleanfrominput name=pid assign=pid]-->
    <!--[pnvarcleanfrominput name=uid assign=uid]-->
    <!--[pnvarcleanfrominput name=name assign=name]-->
    <!--[pnvarcleanfrominput name=custom0data assign=custom0data]-->
    <!--[pnvarcleanfrominput name=custom1data assign=custom1data]-->
    <!--[pnvarcleanfrominput name=custom2data assign=custom2data]-->
    <!--[if $name == ""]--><!--[assign var=name2 value=$userdata.uname]--><!--[else]--><!--[assign var=name2 value=$name]--><!--[/if]-->
    <div >
    <!--[php]-->
    $publication = array();
    $publication['core_author'] = $this->_tpl_vars['name2'];
    $publication['core_creatorID'] = $this->_tpl_vars['uid'];
    $publication['core_creator'] = $this->_tpl_vars['userdata']['uname'];
    $publication['core_approvalState'] = 'approved';
    $publication['core_approvalTitle'] = '';
    $publication['core_topic'] = -1;
    $publication['core_showInList'] = 1;
    $publication['core_showInMenu'] = 1;
    $publication['core_online'] = 1;
    $publication['core_revision'] = 0;
    $publication['core_language'] = 'x_all';
    $publication['core_publishDate'] = date('Y-m-d G:i');
    $publication['core_expireDate'] = '';

    //here we have the most important things: publication fields
    $publication['title'] = $this->_tpl_vars['name2'];
    $publication['pid'] = $this->_tpl_vars['pid'];
    $publication['Antwoord_1'] = $this->_tpl_vars['custom0data'];
    $publication['Antwoord_2'] = $this->_tpl_vars['custom1data'];
    $publication['Antwoord_3'] = $this->_tpl_vars['custom2data'];
    $this->_tpl_vars['pub'] = $publication;
    <!--[/php]-->
    <!--[pnmodapifunc modname="pagesetter" type="edit" func="createPub" tid="16" pubData=$pub]-->


    I just call the custom fields with pnvarcleanfrominput, and it works pretty well...
    Maybe that's something you need for your new input from in Formicula.

    - Igor
  • 0 users

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