drupaldrupal-7drupal-viewsdrupal-taxonomy

Display article teaser Drupal 7


Hello i'm using drupal 7. I'm displaying some articles according to their taxonomy and tag with views_embed_view(). When i created my view, i told that I wanted to show an article teaser, but it always display all the content. Is there a solution ? like wordpress for example excerpt() or some parameter for the views_embed_view() function ? Thank you.


Solution

  • Views embed function must have two parameters:

    print views_embed_view($view_name , $display_id);
    

    Where:

    You can use additional arguments for your contextual filters:

    print views_embed_view('views_name', 'display_id', $term_id, $user_id, etc.. );
    

    In your case here there is no need for additional arguments. You can go on content type of view that you embed and on display settings set up teaser. In your case:

    admin/structure/types/manage/article/display/teaser
    

    There you have on field->format->body (assuming that there is your content) options trimmed or summary or trimmed and there you can set up your teaser.

    Hope this helps.