0

I recently purchased and installed a Shop By Brands extension from Mageplaza. Once installed I realized the actual Brands Page did not have a Meta Tags (Title, Keywords, Description) section. Is it possible to create a file for that page that can have this feature. The actual individual brands do have the tags. Need the main Shop By Brands page to display the tags.

1 Answer 1

0

Option.1 Add in phtml.(if dynamic value) for that open your brands xml file like. brand_index_index.xml and add below code

<referenceBlock name="head.additional"> <block 
class="Vendor\Module\Block\CustomHead" name="custom_head" 
template="Vendor_Module::custom_head.phtml"/> </referenceBlock>

now create "custom_head.phtml" in your "view/frontend/templates" and add your code as your need. lie below

<meta name="title" content="Welcome Brands"/>
<meta name="description" content="This is brands test descriptions"/>
<meta name="keywords" content="Brands, brand, your keywords"/>

option 2. you can directly add meta tag in xml instead of php

open your module xml file . like "brand_index_index.xml" and add below code. dont replace existing code please set as per your need.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <head>
    <meta name="title" content="Welcome Brands"/>
    <meta name="description" content="This is brands test descriptions"/>
    <meta name="keywords" content="Brands, brand, your keywords"/>
   </head>
</page>

accept solution if helps you

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.