Web Analytics

Fill the form & Get Installation Support

    More/Less functionality in Magento2

    First of all, we need to create several files:

    Let’s review these files and see here description for each one regarding which code will be placed inside of them:


    Use this file to register your own JavaScript component:


    Inside of the content  container, a new block is created with a specified template file that is going to be used:


    This file contains the basic configuration of the more/less functionality.


    Place all of your JavaScript logic in this file. Skeleton of such a JavaScript component should be like this:


    This is an optional file for you to create, I have created some minimal styling (transparent-to-solid background) as a nice effect on the more/less button.

    Here is how it looks like on the frontend:

    Fill the below form if you have any Magento programming need.

      Recent Articles

      Author Info

      Author Image

      Magento Certified Developer

      Hire J. Lakum

      Get a Free Quote

        Connect With Us