• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

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

How to create custom theme in Bagisto?

Knowledge Base
7
11
8.4k
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 8 Feb 2019, 09:42

    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
    • 8 days later
    • N
      np last edited by 16 Feb 2019, 06:02

      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 16 Feb 2019, 06:08 Reply Quote 0
      • N
        np @np last edited by 16 Feb 2019, 06:08

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

        N 1 Reply Last reply 16 Feb 2019, 06:30 Reply Quote 0
        • N
          np @np last edited by 16 Feb 2019, 06:30

          @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 18 Feb 2019, 05:14

            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
            • 2 months later
            • T
              tilak last edited by 11 Apr 2019, 09:28

              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 12 Apr 2019, 04:27 Reply Quote 0
              • admin
                admin @tilak last edited by 12 Apr 2019, 04:27

                @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 17 Apr 2019, 14:01

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • N
                    Naresh-webkul last edited by 18 Apr 2019, 06:59

                    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 18 Apr 2019, 14:46

                      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 22 Apr 2019, 07:44

                        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
                        2 out of 11
                        • First post
                          2/11
                          Last post