Bagisto Forum

    Bagisto

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

    Custom Theme in Separate Package

    Knowledge Base
    3
    8
    596
    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.
    • P
      porl last edited by

      Hi there
      I am trying to determine if Bagisto suits my needs for an urgent project.
      So far things are looking okay, however I am struggling to work out how to create a custom theme that is able to be kept within its own package (I do not want to be editing files in too many places outside of this package for the theme as I want to be able to easily reuse it in other projects).
      How do I go about setting up the views_path etc. in themes.php to point to views within a specific package (e.g. ACME/CustomTheme)?
      Secondly, is there any "minimalist" theme out there I can look at? Even the default theme has a lot of extra stuff in it I don't need and whilst I can of course start with that and remove what I don't want it would be nice to have something that is the absolute minimum for a working "shop".
      Thanks

      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        Hi @porl,

        There is no minimalist theme right now. For theme creation, you need to take the exact file structure of the shop package.

        Just start with the views directory of the shop package.

        1 Reply Last reply Reply Quote 0
        • P
          porl last edited by

          Hi @devansh-webkul
          Thanks for that. I have a package with a mirrored views directory from the shop package, but how to I reference it from the themes.php file?

          1 Reply Last reply Reply Quote 0
          • P
            porl last edited by

            Hi again
            Never mind, I found the solution.
            For anyone else with the same issue I needed the full path (relative to the root Bagisto directory).

            eg:

            'views_path' => 'packages/ACME/CustomTheme/src/Resources/views/shop',
            'assets_path' => 'packages/ACME/CustomTheme/src/Resources/assets',
            

            Not sure if there is a cleaner way to do this but it works at least.

            1 Reply Last reply Reply Quote 0
            • devansh-webkul
              devansh-webkul last edited by

              Hi @porl,

              Exactly, you need to give the path in the themes.php file and change the default view.

              1 Reply Last reply Reply Quote 0
              • L
                lukasyelle last edited by

                Hi there! @porl @devansh-webkul @developerus Is it possible to do this better by utilizing

                php artisan vendor:publish
                

                and selecting the appropriate custom package to publish? My team is trying to do something similar, but are running into the same issue and the relative path solution seems suspect to me. There has to be a better way.

                1 Reply Last reply Reply Quote 0
                • devansh-webkul
                  devansh-webkul last edited by

                  Hi @lukasyelle,

                  It depends on development, if someone only wants to do the CSS stuff then this command is not needed because use can directly do in the resources folder.

                  However, if you totally want to change the package and make theme from scratch. Then you can create a new package and use that command which you are telling by registering your assets in the provider.

                  1 Reply Last reply Reply Quote 1
                  • L
                    lukasyelle last edited by

                    Thank you @devansh-webkul

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