Questions about Payment Form extension

Customise form layout..

More
12 years 7 months ago #11336 by Grant
Customise form layout.. was created by Grant
I need to customise the form layout but in such a way that I can choose a different template/layout per form I do.
I've tried adding it to an article but this doesn't help with the form layout unless I embed several smaller forms into the article but this isn't the most efficient way to collect information or payment for my client.

Recently bought Payment Form, the write-up and features sounded great but didn't realise the tutorial for creating new form layouts was not ready yet even though I've seen from the forum this was in the works 10 months ago.

Any help would be appreciated.
Thanks

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
12 years 7 months ago #11375 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Customise form layout..
Hi

I will spend time this weekend to write up the document. Please be patient and wait for you. You can expect the tutorial document to be available on Monday next week !

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #11463 by Grant
Replied by Grant on topic Re: Customise form layout..
Hi,

Any luck with the document about creating own form layouts for PMF?

Noticed its not up yet. Is there anyway of getting a rough draft even to get me started. As I said I bought this especially for this functionality.

I can post a support ticket if need be to get access to the information if thats how you'd like to get it to me.

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
12 years 7 months ago #11481 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Customise form layout..
Sorry, still haven't had any chance to write the tutorial yet. Will try my best to give you some guide on tomorrow so that you can start working on it and finish the tutorial this weekend !

Sorry again for the inconvenience . I really busy these days to add new features to some of my extensions !

Tuan

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
12 years 6 months ago #11615 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Customise form layout..
Hi

Again, I am really sorry for not being able to write tutorial for this yet. Here are the short instruction for creating a custom layout. Below are the necessary steps :

1. Get the file default.php from components/com_pmform/views/form/tmpl/default.php, rename it to the name you want, for example, mynewlayout.php

2. Remove the code to render the fields :
Code:
foreach ($this->fields as $field) { switch ($field->field_type) { case FIELD_TYPE_HEADING : ?> <tr> <td colspan="2" class="heading"><?php echo $field->title ; ?></td> </tr> <?php break ; case FIELD_TYPE_MESSAGE : ?> <tr> <td colspan="2" class="message"> <?php echo $field->description ; ?> </td> </tr> <?php break ; default: ?> <tr> <td class="title_cell key"> <?php echo $field->title ; ?> <?php if ($field->required) { echo '<span class="required">*</span>' ; } if (strlen(trim($field->description))) { ?> <p class="field_description"><?php echo $field->description ; ?></p> <?php } ?> </td> <td class="field_cell"> <?php echo $field->output ; ?> </td> </tr> <?php } }

3. Add necessary HTML , PHP code to render the form in the new layout you want. Two important note about rending a field :

- To render title of field, you can use the code below :
Code:
<?php echo JText::_('This is field title'); ?>

- To render output of the field :
Code:
<?php echo $this->fieldsOutput['name_of_field']?>



For example, to render field first name, we can use :
Code:
<tr> <td> <?php echo JText::_('First Name'); ?> </td> <td> <?php echo $this->fieldsOutput['first_name'] ; ?> </td> </tr>
To render field last name, we can use code :
Code:
<tr> <td> <?php echo JText::_('Last Name'); ?> </td> <td> <?php echo $this->fieldsOutput['last_name'] ; ?> </td> </tr>


Hope this give you some idea ! If you have other questions, please let me know !

Tuan
?>
[/code]

Please Log in or Create an account to join the conversation.

More
12 years 5 months ago #12215 by penguinhead
Replied by penguinhead on topic Re: Customise form layout..
Hi Tuan

Just to clarify the instructions above for creating a new template, is it correct that I need to find and delete the code identified in Step 2 and then replace it with the new php/html code required for the new layout as per Step 3??

Also, are you able to give any further indication as to when more comprehensive instructions for this functionality will be available?

keep up the great work!

Mike

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc