Question: I have created a product attribute of type text area. Its typical value will be a unordered list, such as:

```
<ul>
<li>line 1</li>
<li>line 2</li>
<li>line 3</li>
</ul>

```

The attribute code is 'usp'
I wish to display this attribute on the product screen and have created a new template for this purpose. When I hard code a value in the template, it displays properly. However, when I put the following 

```
<?php echo $this->getProduct()->getAttributeText('usp') ?>

```

in the template, I get an error:

> 
> Call to a member function getAttributeText() on null in...
> 
> 
> 

How should I code this?

Answer: 
First you have to use helper to call this method of yours. So try below code:

```
<?php 
    $_helper = $this->helper('Magento\Catalog\Helper\Output');
    $_product = $block->getProduct(); 
    echo $_helper->productAttribute($_product, $_product->getUsp(), 'usp');
?>

```

OR

You can assign value of your attribute to any variable and than call that variable wherever you need. see below code:

```
<?php 
     $_helper = $this->helper('Magento\Catalog\Helper\Output');
     $_product = $block->getProduct(); 
     $usp = $_product->getResource()->getAttribute('usp')->getFrontend()->getValue($_product);
?>

```

you can use this variable `$usp` wherever you want.

Another thing is that if you want this attribute for current particular product then you could use below code:

```
<?php 
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $_helper = $this->helper('Magento\Catalog\Helper\Output');
    $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product 
    $usp = $product->getResource()->getAttribute('usp')->getFrontend()->getValue($product);
?>

```
Use below code inside your new template.

```
<?php
 $_product=$this->getProduct();
 $_helper = $this->helper('catalog/output');
 echo $_helper->productAttribute($_product, $_product->getUsp(), 'usp');
 ?>

```

or you can use 

```
<?php echo $this->getProduct()->getUsp() ?>

```

we use **$this->getProduct()->getAttributeText('usp')** if attribute is dropdown type. that's why it is not working here.