I have found a lot of examples on how to create an extra attribute for the categories. I want to create a text field for adding a different H1 - instead of using the category name as the headings, on the category pages.
But how can I fetch the attribute from the title.phtml file?
(\app\design\frontend\Vendor\Theme\Magento_Theme\templates\html\title.phtml)
I have this to check if on a category page in title.phtml:
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$request = $objectManager->get('Magento\Framework\App\Action\Context')->getRequest();
/*
* Check if on product page
* ------------------------
*/
if ($request->getFullActionName() == 'catalog_category_view') {
...
}
?>