title: Magento - get results view HTML for a collection of products
body: <p>I get a list of magento ids from a web service. I load these into and array <code>$product_ids</code>, so I have something like this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; 1965
      [1] =&gt; 3371
      [2] =&gt; 1052
  )
  </code></pre>
  
  <p>I can then make this into a collection:</p>
  
  <pre><code>$collection = Mage::getModel('catalog/product')-&gt;getCollection()
              -&gt;addIdFilter($product_ids);
  </code></pre>
  
  <p>Using my Magento inspector, I've seen that the category pages use the class <a href="http://docs.magentocommerce.com/Mage_Core/Mage_Core_Block_Abstract.html" rel="nofollow"><code>Mage_Catalog_Block_Product_List</code></a> to display lists of products. I'd like to do something similar in my class. I've tried loading:</p>
  
  <pre><code>$ProductList = new Mage_Catalog_Block_Product_List();
  $ProductList-&gt;setCollection($collection);
  </code></pre>
  
  <p>And then I've tried to load the HTML of the results as follows:</p>
  
  <pre><code>$CollectionHTML = $ProductList-&gt;_toHtml();
  </code></pre>
  
  <p>But <code>$CollectionHTML</code> is empty.</p>
  
  <p>How would I get the HTML of what you see in the list view (i.e. the generated output of frontend/base/default/template/catalog/product/list.phtml, but given my collection)? </p>