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
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.
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
That will open up a sidebar modal that will have the option to select the Brands Widget.
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.
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.
--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:
<?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:
Let me know if this gets you where you need to be!