How to add advertisement node at the end of Slideshow I have three content type 
1) Slideshow
2) Slides
3) Advertisement

While creating slideshow we can assign slides to slideshow with nodereference field.
We have created a views for slideshow on the view page of slideshow we are displaying all the slides one by one and there are two links next and previous.
Now I want to add a single Advertisement at the end of this slideshow view.

I tried hook_views_api() and hook_views_query_alter().
Content type slides and advertisements have different fields.
slides are usually images or maybe node bodies (html). It doesnt really matter that advertisments have different fields. I had some code in Drupal 6 you could adapt to D7 or your needs, look into hook_views_pre_render() ...

You simply want to load your advertisement node(s) before the view is rendered and add them to the end of the slideshow ... see below.

//d6 example
function MYMODULE_views_pre_render(&amp;$view) {

  if ($view-&gt;name == 'your_view' &amp;&amp;
    $view-&gt;current_display == 'slideshow_xyz') {
    // Insert something to the end of the view results.
    // For example another "node" or advertisement.
    $some_node = node_load(array('nid' =&gt; 456));
    // make a fake view row item with your advertisement.
    // you should create all fields used in "slides" from your
    // advertisement node data.
    $advertisement_item = new stdClass();
    // add your advertisement fields as fields being used by the Slide view.
    $advertisement_item-&gt;a_field_views_is_using = $some_node-&gt;advertisement_field_1;
    //  ... add all other view row items you are using ....
    // make this advertisement "row" in the results appending to the view results for slides.
    array_push($view-&gt;result, $advertisement_item);
  }
}