0

I'm working on an academic wiki containing two types of pages: an 'Author page' and an 'Article page'. I am trying to create a block view displaying all the articles written by an author into her corresponding page. The view selects the 'Article pages' using a content type filter and I tried to use contextual filters to select the articles written by a particular author.

The difficult part is that the 'Author page' and the 'Article page' do not share a similar field for the author's name. However, when creating an 'Article page', the user has to enter all participating authors and the URLs corresponding to their respective page in the wiki.

So what I would like to do is to use the last component of this URL (the node ID of the 'Author page') and compare it to the node ID of the page the user is looking at. If the IDs match, the view displays selected fields from the 'Article pages' which have written by the author the user is looking at. But so far I have been unsuccessful in doing so, any hint on how I could perform this functionality?

I'm new using Drupal (and site building actually), so I apologize if my question lacks clarity or details.

Thanks in advance for your help!

Igor

0

I found a much simpler solution than what I was trying to do: I used node references. That's exactly what I needed but I wasn't aware of the existence of this functionality. So yes, the solution is simply to use a node reference to link the 'Article page' to the 'Author page'.

0

I had a similar issue a while ago. I understand that you have already solved the issue for yourself but I think a reply may help other who stumble here through Google.

To set the contextual filter you need to add the Relationship, "Content: Author" (this is located under the advanced tab when creating the view).

The add a Contextual filter "User: Uid". When making the filter you also need to set the following option:

Under When the default value is not available

Provide deault value of type "User ID from URL".

  • Thanks a lot Sigvard for the input. In my understanding, the solution you suggest would be very helpful if the "Author" I was referring to was an actual user of the website. However, when I refer to an Author, it should be considered as a simple page. The website I am building is a participatory repository of academic works and their respective authors. So again, the author is not a user. I realize the terminology might be confusing, I should have stressed the difference in my question. Thanks a lot for your answer though, greatly appreciated! – Igor Mar 4 '14 at 2:47
  • Darn, I thought I finally could help someone in the community. But I will probably end up using your solution for a completely different issue. =) – Sigvard Mar 5 '14 at 7:53

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.