related feedback
Posted: 22 January 2011 04:52 AM   [ Ignore ]
Cleans up Nice!
RankRank
Total Posts:  261
Joined  2010-05-25

Hi,

I was wondering if the following has been done before and is possible with safe cracker.

Short scenario. I have two channels. 1 is for ‘products’ and another one if for ‘feedback’. The safe cracker form posts new entries to the feedback channel. This all works great.

The feedback channel also has playa field to relate the feedback to the products.

So, my question. Rather than having to go into the feedback entry manually and adding the product relationship in the playa field. is it possible for safe cracker to ‘remember’ what product the user gave feedback on and store that in the playa field? this way I can relate the feedback with the product and also reverser relate the product with the feedback.

every product has a a link to the safe cracker ‘feedback’ form, so I wonder if I could pass along the entry id into the playa field on the safe cracker feedback form??

ideas, thoughts, code?? anything is appreciated to get me started.

best
Florian

EDIT:

showing the playa field is extremely easy.

{custom_fields}
        {if playa}
            {display_field}
        {
/if}
{
/custom_fields} 

that gives me the actual playa interface and lets me select the product.

I am not sure how I would go about prepopulating this based on what product link I come from? I think i could probably pass along the entry_url in the url somehow but how would I tell the playa field to use that? I dont necessarily want to show the entire playa interface,. this should happen in the background based on what product entry the user clicks from

[ Edited: 22 January 2011 05:46 AM by Florian Auckenthaler ]
Profile
 
 
Posted: 25 January 2011 10:23 PM   [ Ignore ]   [ # 1 ]
Absolute Heartthrob!
Avatar
RankRankRankRankRank
Total Posts:  10369
Joined  2008-09-29

s it possible for safe cracker to â??rememberâ?? what product the user gave feedback on and store that in the playa field?.... I am not sure how I would go about prepopulating this based on what product link I come from? I think i could probably pass along the entry_url in the url somehow but how would I tell the playa field to use that? I dont necessarily want to show the entire playa interface,. this should happen in the background based on what product entry the user clicks from

The best way to figure this out, is to look at the page source, and see what Playa is outputting. Somewhere on the page there will be some kind of input field / text field / hidden field storing the existing playa values. If you EDIT an entry with safecracker you’ll see how these entries are being stored. If you want to manually set a hidden field with a specific value, you’ll need to do it in the format that Playa expects.

1. Find out what format data is stored in with Playa (I would guess serialized)

2. Convert your data to Playa’s format

3. insert in the relevant field.

Safecracker can let you work with the custom field on its own terms, but trying to short circuit that process requires a little familiarity with the fieldtype itself.

 Signature 
Profile
 
 
Posted: 25 January 2011 10:29 PM   [ Ignore ]   [ # 2 ]
Cleans up Nice!
RankRank
Total Posts:  261
Joined  2010-05-25

Chris, perfect! This will get me started! thank you so much for your detailed explanation! as always,

I appreciate it

Profile