Download the PHP package jahvi/magento2-copy-theme-override without Composer
On this page you can find all versions of the php package jahvi/magento2-copy-theme-override. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jahvi/magento2-copy-theme-override
More information about jahvi/magento2-copy-theme-override
Files in jahvi/magento2-copy-theme-override
Package magento2-copy-theme-override
Short Description Magento 2 command to automatically copy files into active theme
License MIT
Informations about the package magento2-copy-theme-override
Magento 2 Copy Theme Override Command
🎩 Magento 2 command to automatically copy files into active theme.
Installation
- Install via composer
composer require jahvi/magento2-copy-theme-override --dev
- Run
php bin/magento setup:upgrade
How it works?
After installing the extension you will have access to a new command:
This takes a single $file_path
argument which is the absolute path of the CSS, LESS, JS, PHTML or HTML file you want to override in your theme, so for example to override the product/list.phtml
template you'd run:
And it will copy the file into your theme as:
Setting up your IDE
By itself the command is not very useful but most IDEs or code editors provide a way to run custom commands using keyboard shortcuts that will help simplify this workflow, below are some examples of a few popular ones.
VS Code
-
Create a
.vscode/tasks.json
file in the project root with the following content: - Open the file to override.
- Run build task shortcut, by default
Shift + Cmd + B
orCtrl + Shift + B
on Windows/Linux.
Sublime Text
-
Create new build system
Tools > Build System > New Build System...
with the following content: - Open the file to override.
- Run Build task, by default
Cmd + B
orCtrl + B
on Windows/Linux.