2

I want to set a flag to link to a node creation page - i.e., when a user clicks on the flag ("Apply for this Job") they should be redirected to a Job Application creation page where they can fill out an application for the job.

So for flag action I selected the "Redirect to URL" action and entered node/add/job-application. But when a user clicks on the flag there's no such redirection, the user is never sent to the node creation page. Am I missing something or just using the wrong method?

1
  • There is an issue about that on drupal.org for Drupal 6 but it seems that it doesn't work on drupal 7 too. Maybe try to do that with your own module as they said :hook_flag and $_GET['destination'] = 'your/url'
    – Epok
    Commented Sep 3, 2012 at 22:38

2 Answers 2

1

Ok, I myself test this for you, please first install and enable Rule and Rules UI ,after it (I suppose you have a flag with 'myflag') . Go to dmin/config/workflow/rules and Add new rule ,set your name and in React on event in flag group select A node has been flagged, under "myflag" save it ,after it in Actions section choose Add action , in Select the action to add in system group choose Page redirect ,after it set your path want to redirect it in Value. (is better check Force redirect). I hope works for you correctly.

2
  • Thanks zhilevan, I got it to work. But there is one more thing I had to do to make it work - I had to make the "Link type" a Normal Link. It seems that it does not work with AJAX.
    – iRex
    Commented Sep 4, 2012 at 13:35
  • I am with you, keep on. please select javascript type instead of link type in yourflag settings
    – Yuseferi
    Commented Sep 4, 2012 at 18:32
0

If you jobs is too force I suggest you handle your job with jquery and javascript.

something like this

$('.flaglinkclass').click(function(){
  document.location.href = "youroptionamlpath";
 });
3
  • I'm not much of a programmer, and I was hoping there was a simpler way of doing this. I can use node reference, but the reason I was going with the flag module was that I could use the off switch to disable the Apply link and put in a message like "You have already applied".
    – iRex
    Commented Sep 4, 2012 at 6:54
  • what is your drupal version?
    – Yuseferi
    Commented Sep 4, 2012 at 7:09
  • it is drupal 7 version
    – iRex
    Commented Sep 4, 2012 at 8:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.