title: Magento get which layout being used on phtml files
body: <p>Is there a way I could get which layout being used on a certain phtml files?</p>
  
  <p>Here in my case, I want to check what layout being used on catalog/list.phtml, I used that information to make conditional "if" on the product image grid size.</p>
  
  <p>I've tried to google it out. But all the result is just explaining about xml layout things. The closest clue I got is this thread</p>
  
  <p><a href="https://stackoverflow.com/questions/7027822/magento-get-layout-for-given-page">Magento get layout for given page</a></p>
  
  <p>which stated the use of this snippet</p>
  
  <pre><code>$left_block = $this-&gt;loadLayout()-&gt;getLayout()-&gt;getBlock('left');
  </code></pre>
  
  <p>but when I tried it on the phtml files, I got an exception error</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>joe's answer below has give me some more clue, the exception gone. But the behavior doesn't really what I need. That snippet of code seems to be just check whether the specified block is defined on the XML. What I really need is whether that block exist on a certain page.</p>
  
  <p>In my case, I need to check what layout being used on catalog/product/list.phtml. if it's 3 columns, I'm gonna make the image resized smaller. If it 1 column, I'll make it bigger.</p>
  
  <p>Is there any way I could do that??</p>