Create Related Articles by Taxonomy Term Automatically with Maximum Number of Related Articles (i.e. 6 Max Related)

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by cneumann on April 8, 2012 at 7:26pm

Is there a way to relate existing articles when creating new content? I assume that it might be a rule?

Assumptions: There are articles that already have a taxonomy of "crime."
Workflow:
1.Create new article
2. Instead of manually associating Related Articles in Article creation page, have the LAST 6 (for example) Related Articles with the Taxonomy Term of "crime" relate to the new Article automatically.

I am thinking that this might be able to be done with a rule, but that level of complexity is outside my realm.

Thoughts?

Comments

This can be accomplished

Posted by fabsor on April 9, 2012 at 8:14am

This can be accomplished through views.

  • Enable the views UI module
  • Go to admin/structure/views and click add view.
  • Name the view whatever you want and select that it's going to show content of type article. Uncheck the "Create page" checkbox.
  • Click "Continue and edit".
  • Under "Advanced", add a "Contextual filter", and search for "taxonomy". You should find something called "Content: has taxonomy term id". Add that contextual filter.
  • Adjust the display of you view however you like by choosing a style of your choice and add whatever fields you want to have.
  • Under "Displays" (at the top), click "Add", and select "Content pane".
  • You now have a secton called "Pane settings", and there is an option called "Argument input" there. Click edit on that.
  • You can now select however you want to get your arguments from panels. Select "From context". Scroll down in the second select box until you find "Taxonomy term" and "Term ID", and select that. Click apply.
  • Finally, save the view.
  • Go to admin/structure/pages and edit the "Node template". Select the "Article" variant, and click content. Click the wheel on the region you want to add your view on and click "Add content".
  • Select the group "View panes", and you should find your created view. select that. Click finish.

This should do the trick!

//Fabian Sörqvist

The use case is for article nodes, not terms.

Posted by tomogden on November 21, 2012 at 8:50pm

The steps you described above only work if you are on a term page or are providing a term ID. In the use case, if you are on the node's page, how would you connect the relationship between the terms and the NID?

For myself, what seems like it should be a simple contextual-relationships setup is unexpectedly confounding.

Tom/* Ogden

edit

Posted by tomogden on November 21, 2012 at 8:51pm

Tom/* Ogden

I am working with a live site

Posted by cneumann on April 13, 2012 at 2:45am

I am working with a live site with NS1, will this work in NS2 as well? I am working on developing and migrating NS1 to NS2.

NodeStream

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /