magento phtml content does not show in product page view.phtml
<p>I am creating a custom block inside product page <code>view.phtml</code>. The block is successfully created because I can see the block when I turn on the path hint. Initially I was just using some plain HTML content for the template something like below:</p>

<pre><code>&lt;div&gt; 
this is the new block
&lt;/div&gt;
</code></pre>

<p>But if I change the template to phtml content, it returns message that I am calling a non-object function. like below: </p>

<p><strong>TEMPLATE</strong></p>

<pre><code>&lt;?php $_helper = $this-&gt;helper('catalog/output'); ?&gt;
&lt;?php $_product = $this-&gt;getProduct(); ?&gt;
&lt;?php $productName = $_helper-&gt;productAttribute($_product, $_product-&gt;getName(), 'name'); ?&gt;
&lt;?php $productUrl = $_helper-&gt;productAttribute($_product, $_product-&gt;getProductUrl(), 'product_url'); ?&gt;
&lt;?php $productImage = $_product-&gt;getImageUrl() ?&gt;  

&lt;div class="socialShare clearfix"&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a class="fa fa-facebook" href="javascript:popWin('https://www.facebook.com/sharer/sharer.php?u=&lt;?php echo urlencode($productUrl); ?&gt;&amp;t=&lt;?php echo urlencode($productName); ?&gt;', 'facebook', 'width=640,height=480,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes');" title="&lt;?php echo $this-&gt;__('Share it') ?&gt;"&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p><strong>ERROR MESSAGE</strong></p>

<blockquote>
  <p>Fatal error: Call to a member function getName() on a non-object in
  /home/onebig/public_html/app/design/frontend/ma_hitstore/default/template/catalog/product/view/socialShare.phtml
  on line 3</p>
</blockquote>

<p><strong>catalog.xml</strong> I have the following codes</p>

<pre><code>&lt;catalog_product_view translate="label"&gt;
    &lt;reference name="content"&gt;
        &lt;block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml"&gt;
            &lt;block type="core/template" name="product.info.socialShare" template="catalog/product/view/socialShare.phtml"/&gt;
    &lt;/reference&gt;
 &lt;/catalog_product_view&gt;
</code></pre>

<p><strong>view.phtml</strong> call the block</p>

<pre><code>&lt;?php echo $this-&gt;getChildHtml('product.info.socialShare'); ?&gt;
</code></pre>

<p>I tested If I paste the template content directly in view.phtml and it works. I guess If I create a custom block I have to redefine all theses php variable <code>$productName</code>,  <code>$productUrl</code>, <code>$productImage</code>  somewhere? Sorry I am new to this. Your knowledge is greatly appreciated. </p>