Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How to create custom theme in Bagisto?

    Knowledge Base
    7
    11
    8308
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • admin
      admin last edited by

      Please follow the below steps on how to create a custom theme in Bagisto.

      • Goto your project’s root directory and check for config folder. Inside it you will find a file called ‘themes.php’:

      themes.php file

      • Check contents of ‘themes.php’ file, it holds all necessary information of creating a custom theme.
        Bagisto Theme File

      Understanding of the parameters

      • default: Declared at the top signifies the currently active or default theme in Bagisto. It is assigned with the value ‘default’. The (string)default indicates the name of the currently active theme.

      • themes: This parameter is where you’ve to define all essentials for your own custom theme. Multiple themes can also be created and used at the same time in Bagisto.

      • Inside ‘themes’ there is another array by name ‘default‘ which is your currently active theme. Containing some key-value pairs.

        • default: When you look inside this array name ‘default‘ it holds few more key-value pairs. such as ‘view_path‘, ‘assets_path‘, ‘name’ all those are explained below:

      Bagisto Theme view

      • views_path: It’ll take the path of your views or blade files that you wanna put up in your custom theme.

      • assets_path: Responsible for your assets i.e images, CSS and javascript files, etc.

      • name: Defines a global name for your theme inside Bagisto.

      • parent: This is a magic parameter that you can find in the commented code below the sub array ‘default‘. Using this parameter you can make use of existing themes inside Bagisto and just customise them even further. This parameter will take the value of the ‘name’ parameter listed in point 3rd above.

      Bagisto existing Themes

      Finally, define your own paths and name of your custom theme inside ‘themes.php’ file. And start creating view files. Do not forget to cover all get routes of shop package having a parameter called ‘view’.

      Storefront Routes

      Make sure the name of the blade file should be same as passed in this GET route file like this:

      alt text

      That will be all on how you can create a custom theme in bagisto. In case of any query, you can raise a support ticket at bagisto.uvdesk.com.

      1 Reply Last reply Reply Quote 0
      • N
        np last edited by

        Hi,

        When i change config themes, the admin themes also change.
        How i can only change front-end theme not admin
        Thanks.

        N 1 Reply Last reply Reply Quote 0
        • N
          np @np last edited by

          @np ![alt text](Screen Shot 2019-02-16 at 13.07.55.png)

          N 1 Reply Last reply Reply Quote 0
          • N
            np @np last edited by

            @np Sorry, I got it, Just create new themes then setting on Admin => Chanels :), Best

            1 Reply Last reply Reply Quote 0
            • B
              bagisto-mogul Banned last edited by

              No worries.
              You can even take the same pattern for developing the theme for admin as i explained in shop.
              Overriding existing views might be the key after you have implemented the above process carefully.

              1 Reply Last reply Reply Quote 0
              • T
                tilak last edited by

                Loved the package at the beginning but cannot get my way around for implementing custom theme. Not even with this tutorial

                admin 1 Reply Last reply Reply Quote 0
                • admin
                  admin @tilak last edited by

                  @tilak Can you let me know at which step you got stuck or facing any issue?

                  1 Reply Last reply Reply Quote 0
                  • R
                    Rafin last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • N
                      Naresh-webkul last edited by

                      Hi,
                      You have to change the default theme to your Custom theme by adding the view_path and assets_path and name in your themes.php file in the config folder .
                      configfolder.png

                      Then next step is to add all yours view files and assets file to that view_path and assets_path .
                      assets_path.png

                      Next you just have to create the folders and file in that path .
                      view_path.png

                      One more thing you have to set your custom theme from your admin pannel .
                      goto->settings->channels->Design

                      customchannel.png

                      1 Reply Last reply Reply Quote 0
                      • R
                        Rafin last edited by

                        Like you have this bagisto_asset; how do I create my own custom_asset?Screenshot from 2019-04-18 20-30-40.png

                        1 Reply Last reply Reply Quote 0
                        • R
                          rahul last edited by

                          Hi,

                          If you want to create your own custom asset, then inside theme packages helper function, you can create your own function as we did.

                          function bagisto_asset($path, $secure = null)
                          {
                          return themes()->url($path, $secure);
                          }

                          After creating this function, you can use it according to your need.

                          Thanks
                          Rahul Shukla

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post