0

I'm creating a simple job board for my company in Drupal 7 w/ Views. I have a view which creates a page that lists all available jobs. Within each job is a truncated description which I have set to trim and display a "Read More" link which goes to the details of the job posting.

To generate the "Read More" link, I am using a contextual filter which pulls the [nid] and in the 'body' section I have the "Read More" link set to node/[nid]. This works exactly the way I need it to.

The issue I'm having is that I have created another page within the view to display the full job posting. And instead of going to www.mydomain.com/node/3166, I want it to go to something like www.mydomain.com/jobs/current/posting/3166. (I'd like to use the nid as some jobs might have the same title).

I go into this view and set the path to 'node/%' and the view shows up formatted and everything when details are clicked, however, setting this bombs out ALL of my other content within the site. So I tried setting the path to something like 'jobs/current/posting/%' and I just can't get it to work.

Does anyone know what I'm doing wrong and/or have a solution or workaround?? TIA

2
  • First of all you don't need Contextual filter in your first case where you are generating link as "node/[nid]" , what you need is replacement pattern. Todo this you can simply add nid to fields list and place above read more link and use the pattern.
  • Change read more link to "jobs/current/posting/[nid]"

Regarding what you are trying to solve

  • You cannot have a view with path "node/%" since it's already taken by node module to render node pages. It will conflict with node module and as you said "bombs out ALL of my other content"
  • In your view set path as 'jobs/current/posting/%'
  • Add a contextual filter nid and set provide default value to content id from URL as shown below.

enter image description here

6
  • Hey Anil, Thanks so much for your reply. You're right on the contextual filter on the first part...i just had my description wrong and was not using a contextual filter. On the problem at hand, I have everything set up as you describe, however, the view still is not showing up when I click on the "More" link. Obviously, I have something set up wrong. Is there anything else I need to check or get set up?? – gev125 Mar 18 '14 at 13:07
  • Can you give me "More link" path ? – Anil Sagar Mar 18 '14 at 14:02
  • sure it's: jobs/current/posting/[nid]. I have tried both like that and with a / in front of 'jobs'...still no dice. – gev125 Mar 18 '14 at 14:31
  • Okay, i've been playing around with it and this is getting strange. If I go into a job post and change the URL alias (which is created by auto-aliasin) in include a "/" at the front, it works..however, now I'm stuck with 2 slashes after my domain name like so: mydomain//jobs/current/posting/3157. It also gives me an error about being in an infinite loop. Any way to get rid of the second slash? – gev125 Mar 18 '14 at 15:37
  • You don't need to change URL alias.. Just point read more link to jobs/current/posting/[nid] .. Let there be node page and view page... – Anil Sagar Mar 18 '14 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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