how to get content type nodes in drupal 7?
is ther开发者_JAVA技巧e a way to get content type node in drupal 7 ? lets say i have a content type (news) and i want last 5 or 10 node with their fields and image to show them in a block in front page. so what is the specific functions to do that like wordpress : get_posts
and what if the site is multilingual and I'm using i18n module is there a functions to get last 5 by English and other for other language ?
The easiest way to do that is to use the Views module
You need Views if
- You like the default front page view, but you find you want to sort it differently.
- You like the default taxonomy/term view, but you find you want to sort it differently; for example, alphabetically.
- You use /tracker, but you want to restrict it to posts of a certain type.
- You like the idea of the 'article' module, but it doesn't display articles the way you like.
- You want a way to display a block with the 5 most recent posts of some particular type.
- You want to provide 'unread forum posts'.
- You want a monthly archive similar to the typical Movable Type/Wordpress archives that displays a link to the in the form of "Month, YYYY (X)" where X is the number of posts that month, and displays them in a block. The links lead to a simple list of posts for that month.
Views is also able to handle multilingual issues.
精彩评论