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?
(appdesignfrontendVendorThemeMagento_Themetemplateshtmltitle.phtml)
I have this to check if on a category page in title.phtml:
< ?php
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$request = $objectManager->get('MagentoFrameworkAppActionContext')->getRequest();
/*
* Check if on product page
* ------------------------
*/
if ($request->getFullActionName() == 'catalog_category_view') {
...
}
?>