Author Topic: combine News module and Mini form ...somehow?  (Read 159 times)

Offline rumen

  • Posts: 228
combine News module and Mini form ...somehow?
« on: January 12, 2017, 09:36:03 AM »
Hello,

1. I try to combine the News module and Mini form. I put the Mini form as droplet in the News module and in the fron end it is visible, BUT IT DOESN"T WORK! Does not send message (in a separate page it works perfect). Here are the 2 secreenshots:





And 2. Can I somehow take automatically in Mini form  in the field "Position (position you apply for)" the field TITLE from the news module?

Regards,

Rumen

Offline Ruud

  • Posts: 3439
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: combine News module and Mini form ...somehow?
« Reply #1 on: January 12, 2017, 10:32:46 AM »
In your form template, set the action ( action={URL} ) to nothing/empty. That way the browser will use the current url to post the form data.

The {URL} variable is generated using the current PAGE_ID, but for news posts this will be the overview page and not the post itself.

Offline rumen

  • Posts: 228
Re: combine News module and Mini form ...somehow?
« Reply #2 on: January 12, 2017, 10:45:26 AM »
You mean to delete action={URL} completely?

To change:
Code: [Select]
<form name="form_{SECTION_ID}" id="form_{SECTION_ID}" method="post" action="{URL}" enctype="multipart/form-data">
With:

Code: [Select]
<form name="form_{SECTION_ID}" id="form_{SECTION_ID}" method="post"  enctype="multipart/form-data">

Offline Ruud

  • Posts: 3439
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: combine News module and Mini form ...somehow?
« Reply #3 on: January 12, 2017, 11:02:17 AM »
You mean to delete action={URL} completely?
Yes, that way the visitor browser will use the current url.

Offline rumen

  • Posts: 228
Re: combine News module and Mini form ...somehow?
« Reply #4 on: January 12, 2017, 11:07:53 AM »
OK I delete the (  action="{URL}"  )  but nothing happens, you can see here:  http://iworkinuk.com/pages/posts/something-3.php   

If it post the message it should go to page: http://iworkinuk.com/pages/thanks.php?lang=EN  but there is no any reaction. Just goues out of the post and that's all.

Offline rumen

  • Posts: 228
Re: combine News module and Mini form ...somehow?
« Reply #5 on: January 12, 2017, 11:18:38 AM »
IT WORKS!

There was small bug I noticed. When I try to modify the form template via the back end link "Modify template" I delete the   (  action="{URL}"  )   but after SAVE it was still there. So I did it via the cwsoft-addon-file-editor  and everything is FINE now!!!

And any idea how can I take the field "TITLE" from the news and put it in the field "Position (position you apply for)" ?

Thanks a lot for the help Ruud!

Offline Ruud

  • Posts: 3439
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: combine News module and Mini form ...somehow?
« Reply #6 on: January 12, 2017, 11:40:55 AM »
IT WORKS!
(Y)

And any idea how can I take the field "TITLE" from the news and put it in the field "Position (position you apply for)" ?
It is possible, but it will be a bit more complicated :-)

Miniform "remembers" previous settings in a session variable $_SESSION['form'][{fieldname}].
You could try to create a simple droplet to set this.
(assuming the fieldname is "mf_r_position")
Code: (untested!!) [Select]
<?php
if(isset($field)) $_SESSION['form']['mf_r_position'] = $field;
return 
true;

in your news output do:
Code: [Select]
[[thedroplet?field=[TITLE]]](note the [TITLE] and 2 closing ]] for the droplet)

A problem might be that the droplet must be called before the sectionpicker droplet, and it is not possible to know the order of droplets being executed.

If it fails you could also combine this droplet with the sectionpicker droplet.
Add the field=[TITLE] parameter to the sectionpicker droplet ( [[SectionPicker?field=[TITLE]&sid=14]] ) and start that droplet with setting the session parameter (just the first line).



Offline rumen

  • Posts: 228
Re: combine News module and Mini form ...somehow?
« Reply #7 on: January 12, 2017, 12:03:44 PM »
It doesn't work. Maybe one simple button with some droplt to copy/paste the field TITLE from the news post to the field in the mini form will be easy solution. And to put this button in the miniform above the field "Posiotn"

Offline dbs

  • Posts: 6699
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: combine News module and Mini form ...somehow?
« Reply #8 on: January 12, 2017, 12:05:43 PM »
Quote from: rumen
There was small bug I noticed. When I try to modify the form template via the back end link "Modify template" I delete the   (  action="{URL}"  )   but after SAVE it was still there.
I have that noticed too. The template will not be saved with same casesensitive-name. I have sometimes after saving two templates with little differents in the name.

Offline rumen

  • Posts: 228
Re: combine News module and Mini form ...somehow?
« Reply #9 on: January 12, 2017, 12:08:16 PM »
Yes, but there is no problem if you use cwsoft-addon-file-editor

Quote from: rumen
There was small bug I noticed. When I try to modify the form template via the back end link "Modify template" I delete the   (  action="{URL}"  )   but after SAVE it was still there.
I have that noticed too. The template will not be saved with same casesensitive-name. I have sometimes after saving two templates with little differents in the name.

Offline Ruud

  • Posts: 3439
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: combine News module and Mini form ...somehow?
« Reply #10 on: January 12, 2017, 12:24:08 PM »
It doesn't work. Maybe one simple button with some droplt to copy/paste the field TITLE from the news post to the field in the mini form will be easy solution. And to put this button in the miniform above the field "Posiotn"

The problem is that miniform does not know about the news-post title. So you cannot put that in the miniform "area".
The droplet solution I described should work. But probably only by modifying the sectionpicker droplet.

Quote from: rumen
There was small bug I noticed. When I try to modify the form template via the back end link "Modify template" I delete the   (  action="{URL}"  )   but after SAVE it was still there.
I have that noticed too. The template will not be saved with same casesensitive-name. I have sometimes after saving two templates with little differents in the name.
In the current version ( 0.8 ) this should be fixed (if I remember correctly)

Offline rumen

  • Posts: 228
Re: combine News module and Mini form ...somehow?
« Reply #11 on: January 12, 2017, 12:26:41 PM »
This option works:


Quote
If it fails you could also combine this droplet with the sectionpicker droplet.
Add the field=[TITLE] parameter to the sectionpicker droplet ( [[SectionPicker?field=[TITLE]&sid=14]] ) and start that droplet with setting the session parameter (just the first line).

Here is the result:   http://iworkinuk.com/pages/posts/something-3-12.php

Offline rumen

  • Posts: 228
Re: combine News module and Mini form ...somehow?
« Reply #12 on: January 12, 2017, 12:39:15 PM »
I think everything works now. If I have a problem will write again.

Friends - thanks a lot for the support, help and the patience you have with me :) I know it is not easy to explain to economist IT things so easy to be understand ...

Thanks a lot once again! God bless you!

 

postern-length