1

I'm going to build a website for a magazine.I have two different content types. In the first one, I will post the first page of magazine. But in the second one is for articles.
Now, my problem is:
I want to show just articles which are related to the issue which displayed on the top. I know how to show latest content [for first content type which includes first page], but i don't know how to show its articles under it. I guess,I would use views, but I don't know how.
to be more clear: I want something like this site.

  • First you need to define the relationship between these two content types. Drupal can't magically know how articles belong to which piece of front page content. – Letharion Apr 25 '12 at 19:21
3

Assuming you have an Issue content type, and an Article content type

Install References and enable Node References. On the Article content type, Add a Node Reference field (could name it "issue") and restrict its options to nodes of type Issue.

Then create a View of Articles and add (under Advanced) a Contextual Filter of Content: Issue (and if you are using url aliases for the Issues, then provide the Contextual filter with a default value of Content ID from URL). Make it a Block display.

Then display the block on Nodes of type Issue, and it should work great for you.

  • thx, I'll give it a try. – Sheshkovsky Apr 25 '12 at 19:46
1

A combination of Panels, Taxonomy and Views could be used for this site. You could use taxonomy terms to differentiate the issues. For e.g for Issue 1, you could enter the term "issue1", for Issue 2 you could use "issue2", etc. Then you could use views to filter content based on Taxonomy terms. This tutorial comes close to what you are trying to build.

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.