0

I'm working on a jobboard type personal project (actually it's a musician type 'apply' for board). I'm a little stuck at a stage within the page flow.

What I want is the said Advertisers 'posting' job Node reference (field ie: Bass Player), so that all items can be crossed referenced within the Drupal system.

The workflow is preferably like this:

1) User (Applicant) views a Vacancy Node page (ie Bass Player Wanted).
2) Applicant clicks Rules Link (RL) "Apply Now" and RL triggers action to page #2 Form to complete. RL relates original Node page to Application so that entity can be later shown (via Views) into both advertiser and Applicants Dashboard's section.
3) Applicant clicks 'Complete Now' button and the RL process completes so as to i) post the application as a Node to system DB (I have an Application Node already done) ii) all

How do I get the job Node Reference field into the user application before they fire it off to submit the job into the system so it can then later be pulled back to both the Node creator (Job) and the applicants Job submit? I have a mental picture of a 'third' reference Node having to be created that 'binds' all references together.

Currently, I've got the node types done, an onscreen application form which is triggered by a Rules Link on a node page taking the user to the 'Application' page and that's where I've become stuck. I know that the Application process has to link (in Drupal we can use Relationships module) and I've looked at the options and installed the Entity Reference Prepopulate but whilst that is good for other future functionality, I'm at a lost where to go next on this and have spent many hours scratching my head.

Thanks in advance for any advice or explanation on how this generally works would be very helpful.

I posted a similar question on Drupal SE, but I have had no relevant advice.
https://drupal.stackexchange.com/questions/114432/

Community
  • 1
  • 1
Paul B
  • 127
  • 11

1 Answers1

0

Simple enough.

You'll want to add another action to your Rules Link to Set a Data Value inside of the 'Created Entity' (this is a configurable variable created by your Rules Link) in your Entity Reference Field based on the 'Node' Data Selector.

Make sure you add an action to Save the Entity before the Page Redirect action (assuming you use one).

To clarify, this should all be done within your Rules Link Rule!

Cheers!


EDIT:

More precisely...

If you run up against something similar, I imagine you'd want your Rules Link actions to look something like:

Create a new entity Parameter: Entity type: Node, Content type: Application, Title: App, Author: [site:current-user] Provides variables: Created entity (entity_created)

Set a data value Parameter: Data: [entity-created:field-job], Value: [node:field-job]

Set a data value Parameter: Data: [entity-created:field-app], Value: [node]

Save entity Parameter: Entity: [entity-created], Force saving immediately: true

Christian
  • 1
  • 2
  • Thanks for very much for your advice @christian. I'll check it out this weekend and get back to this posting with my results. Good karma to you! – Paul B Jun 05 '14 at 21:42
  • My efforts have proved useless! (LOL), Can you elaborate on the actual Rules structure to get something created then published as an 'application' Node; all I get at present is a web error. Thanks in advance. – Paul B Jun 10 '14 at 16:39
  • @PaulB — Apologies! I didn't receive a notification that you'd replied. Please see the updated answer if you run up against something similar. Cheers! – Christian Sep 16 '15 at 16:09
  • Hey thanks Christian, it's sometime ago now and I did something temporary for the time being, but I'll most certainly look over the original issue soon and come back to you with my results. Thanks again for taking the time to put forward your above actions for my Rules. Very much appreciated (-: – Paul B Sep 17 '15 at 13:51