[Freeform] Limit display of freeform:entries by value in a custom Freeform field
Posted: 19 July 2008 06:04 PM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  45
Joined  2006-07-16

I have a case in which i’d like to display Freeform records in which a custom field (such as orderid_ff) matches a certain value. This way I could associate certain freeform entries with certain weblog entries.

A tall order to ask of a free/by-donation module? smile I realize it can already limit by a number of other parameters, such as status. Display of weblog entries can now be limited by a value in a custom field, however, so I was wondering if it was possible for Freeform.

Cheers!

R o B

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

This can be done smile

Just use the form_name="zeus” parameter smile

You can set the form name to be the Entry ID (make sure you place the Freeform:Form code within the Weblog Entries loop…

{exp:freeform:form form_name="{entry_id}"}

Then, also within the Weblog Entries loop, place the Freeform:Entries loop with that same parameter:

{exp:freeform:entries form_name="{entry_id}"}

smile

 Signature 
Profile
 
 
Posted: 21 July 2008 05:04 PM   [ Ignore ]   [ # 2 ]
Jr. Member
RankRank
Total Posts:  45
Joined  2006-07-16

Pie Man,

OK, I’m just a little confused by your answer. Sorry if I’m just not getting it.

I know I can limit by form_name, I’m trying to also limit by a second custom field. Let me explain using an example.

I have a little EE-based ordering system. The orders are in an orders weblog, each with an entry_id. Using Freeform, we now send correspondence to the clients. The correspondence is recorded in the Freeform control panel, of course. In that Freeform, we drop the entry_ID into a custom field, order_ff. This way, we associate those Freeform entries with a weblog entry.

So when I pull up the display of an entry in the order weblog on the front end, say the one with the entry_id 200, I’d like to be able to also show its related Freeform correspondence like this:

{exp:freeform:entries form_name="orders_processed" orderby="entry_date" sort="asc" limit="20" search:order_ff="200"}
--- Correspondence on date: {entry_date}
{
/exp:freeform:entries}

Does this make sense? I don’t have to produce these very fast, so if there’s something weird I can do with a conditional that would even work.

Thanks!

R o B

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

ah, I see LOL

Unfortunately, a custom field search parameter is not available…

If you’re desperate enough though, you could use a conditional:

{exp:freeform:entries form_name="orders_processed" orderby="entry_date" sort="asc" limit="20"}

{if order_ff
== "200"}
--- Correspondence on date: {entry_date}
{
/if}

{
/exp:freeform:entries}

The only issue is, Pagination and “Limit” will be thrown off… if you know what I mean LOL

 Signature 
Profile
 
 
Posted: 22 July 2008 08:53 AM   [ Ignore ]   [ # 4 ]
Jr. Member
RankRank
Total Posts:  45
Joined  2006-07-16

I’m not sure if “desparate” is the word, but… yeah that’s what I thought I would have to do. I’m just not sure how that will behave once we have 1000 or 2000 entries in Freeform.

Just a thought, can queries be used to pull things out of Freeform and other modules? I believe I’ve never tried pulling anything with a query other than straight weblog entries.

R.

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

I’m just not sure how that will behave once we have 1000 or 2000 entries in Freeform.

Armageddon, you mean? LOL rasberry

Oxygen Smith - 22 July 2008 08:53 AM

Just a thought, can queries be used to pull things out of Freeform and other modules? I believe I’ve never tried pulling anything with a query other than straight weblog entries.

Yes, it works with modules and 3rd party modules smile

 Signature 
Profile