Question: I created a view block, whose machine name is "news." 

How do I display it using `module_invoke()` and the machine name of the view?

Answer: 
This Worked for me :

```
$view = views_get_view('view_machine_name');
$view->set_display('Master');
$view->get_title();
$response = $view->preview('You_Block_id');

```

//and called it in html like this//

```
<div class="col-md-4 col-sm-6">
<div class="blocksOuterWrapper companyNewsWrapper">
'.$response.'
</div>
</div>

```
From my own experience, you can transform a path to a view title or content with a function like the following.

```
<?php
function view_path_to_title($path)
{
  // only if your path is a URL alias
  $sql = "SELECT src FROM {url_alias} WHERE dst = '%s'";
  $src = db_result(db_query($sql, $path));

  // if you do not use URL aliases, you probably use $path here instead of $src
  $menu_item = menu_get_item($src);

  // make sure it worked as expected
  if(!empty($menu_item)
  && $menu_item["page_callback"] == "views_page"
  && count($menu_item["page_arguments"]) >= 2)
  {
    $args = $menu_item["page_arguments"];
    $view = views_get_view($args[0]);
  }
  else
  {
    $view = null;
  }

  if ($view)
  {
    // just loading a view is not quite enough, we have to setup the
    // arguments, including the display, and the "execute" the view
    $view->set_display($args[1]);
    array_shift($args); // view name
    array_shift($args); // display name
    $view->set_arguments($args);
    $view->execute();
    $title = $view->get_title();
    if($title)
    {
      return $title;
    }
  }

  // some "random" default
  return $path;
}

```

To render the view, use `$view->render()` instead of `$view->get_title()`.

For sure, until I properly called the `$view->execute()`, nothing worked right. I would get empty strings (maybe null) as return values.