title: Magento 2.2 - Append Attribute Name To Product Name (H1)
body: <p>This is driving me nuts, I created a module with a helper:</p>
  
  <pre class="lang-php prettyprint-override"><code>    namespace MyNamespace\MyModule\Helper;
  
      class Data extends \Magento\Framework\App\Helper\AbstractHelper
      {
          protected $registry;
  
          public function __construct
          (
              \Magento\Framework\Registry $registry,
          \Magento\Eav\Api\AttributeSetRepositoryInterface $attributeSet
          ) {
              $this-&gt;registry = $registry;
          $this-&gt;attributeSet = $attributeSet;
          }
  
          public function getTitle()
          {
              $this-&gt;product = $this-&gt;registry-&gt;registry('product');
          $product_name = $this-&gt;product-&gt;getName();
              $attributeSetRepository = $this-&gt;attributeSet-&gt;get($this-&gt;product-&gt;getAttributeSetId());
          if ($attributeSetRepository-&gt;getAttributeSetName() == "Default Engine Component"){
          $engine = $this-&gt;product-&gt;getAttributeText('engine_select');
          if (!is_array($engine)){
              return "$engine $product_name";
          }
          }
              return $product_name;
          }
      } 
  </code></pre>
  
  <p>...and this works as it should. Then I added the following to:</p>
  
  <blockquote>
    <p>/app/design/frontend/vendor/theme/Magento_Catalog/layout/catalog_product_view.xml</p>
  </blockquote>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;referenceBlock name="page.main.title"&gt;
      &lt;action method="setPageTitle"&gt;
          &lt;argument name="title" xsi:type="helper" helper="MyNamespace\MyModule\Helper\Data::getTitle"&gt;&lt;/argument&gt;
      &lt;/action&gt;
  &lt;/referenceBlock&gt;
  </code></pre>
  
  <p>...but it changes nothing on the product page. I know it's getting called as I can echo out the vars and they show at the top of the page, but it seems that the XML isn't doing what I hoped it would. </p>
  
  <p>Anyone got any ideas?</p>