Passing FreeForm Data to a Weblog—or, FreeForm Entries author_id parameter
Posted: 09 July 2008 07:13 AM   [ Ignore ]
Newbie
Rank
Total Posts:  6
Joined  2008-04-30

What I’d like to be able to do is for a member to enter data into a FreeForm form, and then immediately and *privately* be able to view that entered data on a personal member page.  For example, the member enters a note to himself via FreeForm, receives e-mail notification of said note, then can immediately review the note on his own private personalized members page.

The two approaches to this I’ve come up with are:

1. Somehow pass the FreeForm data to a SAEF weblog entry automatically (I need to use FreeForm because of the notify function).

2. Use a FreeForm Entries tag with some sort of {author_id="CURRENT_USER"} parameter… which if I’m not mistaken doesn’t exist yet?

Are either of the two approaches possible?  Is there a different way to accomplish this that I haven’t thought of?

Profile
 
 
Posted: 09 July 2008 07:33 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3374
Joined  2006-10-18

Using the send_user_email="yes” parameter will allow you to have a copy sent to the member… smile
To then display a template that shows their “notes”, there currently isn’t an “author” parameter yet.... though I wonder if as a temporary workaround would be to do something like this:

{exp:freeform:entries form_name="notes" orderby="entry_date" sort="asc"}

{if author_id
== "{member_id}"}
<h1>{title}</h1>
<
p>{date}</p>
<
p>{message}</p>
{/if}

{
/exp:freeform:entries}

Or, come to think of it, you could set the Freeform Form to look like this:

{exp:freeform:form form_name="notes_{member_id/OR/segment_3}" return="template/path"
send_user_email="yes" user_email_template="some_template" required="title|message"}

<p>Title<br />
<
input type="text" name="title" value="" /></p>
<
p>Message<br />
<
textarea name="message"></textarea></p>
<
p><input type="submit" name="submit" value="Submit" /></p>

{/exp:freeform:form}

Then pull the entries the same way wink
No guarantee these methods work LOL

 Signature 
Profile
 
 
Posted: 09 July 2008 08:00 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  6
Joined  2008-04-30

Hi Pie Man, thanks for the super quick response!  I guess I’ll go ahead and put an author_id feature request in for “pro”.

I’ve tried the second way, but unfortunately the form_name parameter doesn’t appear to parse the {member_id} in the freeform:entries tag.  I do currently have it set so that when a member submits a form, they create their own freeform form_name, but it’s a no go with the entries tag for some reason.

The conditional method as entered doesn’t seem to be working—I may try mucking around a bit more with conditionals and see if I can’t find a way to do it.  Thanks for the inspiration!

Profile
 
 
Posted: 09 July 2008 08:22 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3374
Joined  2006-10-18

Does the {segment_3} variable work… with a Segment in the URL of course smile

 Signature 
Profile
 
 
Posted: 09 July 2008 08:48 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  6
Joined  2008-04-30

Hmm, I actually don’t know what that means.  rasberry
What is the segment_3 variable exactly? (please pardon my ignorance) smile

Profile
 
 
Posted: 09 July 2008 08:52 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3374
Joined  2006-10-18

The Segment variables parse as what is in the URL…

So for example, in this URL:

http://www.yoursite.com/apple/pie/17

{segment_1} will parse as apple
{segment_2} will parse as pie
{segment_3} will parse as 17

The idea here is that if your URL looks similar to that, you can pull data or create conditionals based on what is in the URL. smile

If the member ID is in the URL… let say 17 in this case, then if you place {segment_3} into your template, it will parse as “17”

 Signature 
Profile
 
 
Posted: 09 July 2008 03:41 PM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  6
Joined  2008-04-30

Aha, I see!  Thank you for the clarification.

I’d rather keep the member ID out of the URL, because the page is supposed to be a private page that is tailored to each individual member.  I don’t want other members typing in URL’s and getting at sensitive informaiton.  Still, it’s something worth noting for future reference! smile

Looking through the archives, I saw a use of PHP and database query that may be able to accomplish the task for the time being.  It’s not ideal, but it may tide me over until pro is released (hopefully soon) wink

Profile
 
 
Posted: 20 August 2008 11:13 AM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  3
Joined  2008-04-23

Moblogging the user note in, then, EE has an author filter. Gotta run.

Profile