3

I download module Ves_Brand ; i want to create a page that show all brands some ideas please! i know that i have to create a module and controller to show page but what i have to do inside that. Anyone can help i am a beginner in learning magento 2. what is the difference between a simple page and a CMS page ? can anyone explain that to me ? Thank You for all Marki

  • It looks like with the module Ves_Brand you can place brands anywhere such as navigation menu or also the "layered navigation" on the left. These options are controlled from the admin menu once installed. That should help you apply the "all brands". – camdixon Apr 3 '18 at 1:39
  • A CMS page is one you create and manage. Any page you make is a simple page. – camdixon Apr 3 '18 at 1:42
1

I added in the extension on a dev site running Magento 2.2.2. For the most part, you can do all the things you are looking to do with the admin setting for the ext. After the install you need to set up the brands you are looking to show. That is done in the Venustheme tab inside the admin.

enter image description here

From here you need to create a Group first, and then you can create the individual brands. Inside that section (Add New Brand) you can set the image, the url and the products that will be set under the Brand url. The ext is going to create landing pages that act like category pages for you.

After configuring the Brands you can then add them into any CMS Page or Block you like. You mention that you "to create a module and controller" and that's not really how this ext is built to work. While you can totally call a CMS Block with a custom module, the ext is designed to let you place the content using the admin.

In this case I was just using the homepage to place the content. Inside any CMS Page click on the Insert Widget... button right above the Content section.

enter image description here

That will open up a sidebar modal that will have the option to select the Brands Widget.

enter image description here

From there you can select the Brands Group (it will auto select one if there is only one) and the setting for that widget. Saving this you will now have the Brands showing up on what ever page you have created in the admin.

enter image description here

If you click on any of the brands, that will take you to it's own landing page with the products that were selected for that brand in the admin.

enter image description here

--To get this to show up on a custom view--

In reference to your other question How to write a controller to show all brand? all you need to do is create the brands like i described above and then call that CMS Block in the template file with:

app/code/Tester/Brands/view/frontend/layout/tester_brands_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="content">
            <block template="content.phtml" class="Tester\Brands\Block\Main" name="tester_brands_block_main"/>
            <block class="Magento\Cms\Block\Block" name="tester_brands">
                <arguments>
                    <argument name="block_id" xsi:type="string">tester_block</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

This is if you created the controller with pestle as the other answer outlines. Just make sure your block id is tester_block and everything show look like this:

enter image description here

Let me know if this gets you where you need to be!

  • Thank you for response sir it very helpful i just want to create it by using code create a module and controller – user66253 Apr 4 '18 at 16:01
  • I've updated my answer with a link to the other solution for making a controller and how to get that to show up on the page for ya. Hope this helps. – circlesix Apr 5 '18 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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