Magento 2 - Creating a child theme
I purchased a theme for a Magento 2 website. I know want to create a child theme to modify some of the styles, etc.
The theme purchased is called Porto and resides in
/app/design/frontend/Smartwave/porto
So I created a directory
/app/design/frontend/Smartwave/porto_child
I then created a theme.xml file with the below contents
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Proto Child</title> <!-- your theme's name -->
<parent>Smartwave/porto</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
<media>
<preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
</media>
</theme>
I then created a registration.php file
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::THEME,
'frontend/Smartwave/porto_child',
__DIR__
);
I also created a directory called media and put a preview.jpg in there
now when I go to the admin panel I get an error when I view the log in the var/report folder I see an error that says
a:4:{i:0;s:107:"File '/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists."
When I SFTP to the directory I see the file!
When I run (on the command line)
mage setup:upgrade
I get a message that says
[Exception] File'/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists.
Also When i run
sudo bin/magento setup:static-content:deploy -t Smartwave/porto_child
[InvalidArgumentException] Smartwave/porto_child argument has invalid value, available themes are: Magento/blank, Magento/luma, Magento/backend, Smartwave/porto_rtl, Smartwave/porto
magento2 theme parent-child-theme
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I purchased a theme for a Magento 2 website. I know want to create a child theme to modify some of the styles, etc.
The theme purchased is called Porto and resides in
/app/design/frontend/Smartwave/porto
So I created a directory
/app/design/frontend/Smartwave/porto_child
I then created a theme.xml file with the below contents
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Proto Child</title> <!-- your theme's name -->
<parent>Smartwave/porto</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
<media>
<preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
</media>
</theme>
I then created a registration.php file
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::THEME,
'frontend/Smartwave/porto_child',
__DIR__
);
I also created a directory called media and put a preview.jpg in there
now when I go to the admin panel I get an error when I view the log in the var/report folder I see an error that says
a:4:{i:0;s:107:"File '/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists."
When I SFTP to the directory I see the file!
When I run (on the command line)
mage setup:upgrade
I get a message that says
[Exception] File'/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists.
Also When i run
sudo bin/magento setup:static-content:deploy -t Smartwave/porto_child
[InvalidArgumentException] Smartwave/porto_child argument has invalid value, available themes are: Magento/blank, Magento/luma, Magento/backend, Smartwave/porto_rtl, Smartwave/porto
magento2 theme parent-child-theme
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Check if you're theme and porto wasn't registered as virtual theme. In MySQL tabletheme
it should be of type 0 (psychical) and not 1 (virtual). There were various issues with themes because of it. magento.stackexchange.com/questions/92181/…
– obscure
Apr 17 '17 at 20:33
when I look in mysql in the theme table I see the parent theme is listed and is type zero. but the child theme is not listed.
– Jayreis
Apr 17 '17 at 20:47
add a comment |
I purchased a theme for a Magento 2 website. I know want to create a child theme to modify some of the styles, etc.
The theme purchased is called Porto and resides in
/app/design/frontend/Smartwave/porto
So I created a directory
/app/design/frontend/Smartwave/porto_child
I then created a theme.xml file with the below contents
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Proto Child</title> <!-- your theme's name -->
<parent>Smartwave/porto</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
<media>
<preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
</media>
</theme>
I then created a registration.php file
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::THEME,
'frontend/Smartwave/porto_child',
__DIR__
);
I also created a directory called media and put a preview.jpg in there
now when I go to the admin panel I get an error when I view the log in the var/report folder I see an error that says
a:4:{i:0;s:107:"File '/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists."
When I SFTP to the directory I see the file!
When I run (on the command line)
mage setup:upgrade
I get a message that says
[Exception] File'/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists.
Also When i run
sudo bin/magento setup:static-content:deploy -t Smartwave/porto_child
[InvalidArgumentException] Smartwave/porto_child argument has invalid value, available themes are: Magento/blank, Magento/luma, Magento/backend, Smartwave/porto_rtl, Smartwave/porto
magento2 theme parent-child-theme
I purchased a theme for a Magento 2 website. I know want to create a child theme to modify some of the styles, etc.
The theme purchased is called Porto and resides in
/app/design/frontend/Smartwave/porto
So I created a directory
/app/design/frontend/Smartwave/porto_child
I then created a theme.xml file with the below contents
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Proto Child</title> <!-- your theme's name -->
<parent>Smartwave/porto</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
<media>
<preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
</media>
</theme>
I then created a registration.php file
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::THEME,
'frontend/Smartwave/porto_child',
__DIR__
);
I also created a directory called media and put a preview.jpg in there
now when I go to the admin panel I get an error when I view the log in the var/report folder I see an error that says
a:4:{i:0;s:107:"File '/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists."
When I SFTP to the directory I see the file!
When I run (on the command line)
mage setup:upgrade
I get a message that says
[Exception] File'/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists.
Also When i run
sudo bin/magento setup:static-content:deploy -t Smartwave/porto_child
[InvalidArgumentException] Smartwave/porto_child argument has invalid value, available themes are: Magento/blank, Magento/luma, Magento/backend, Smartwave/porto_rtl, Smartwave/porto
magento2 theme parent-child-theme
magento2 theme parent-child-theme
edited Apr 17 '17 at 20:22
Jayreis
asked Apr 17 '17 at 19:44
JayreisJayreis
154730
154730
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Check if you're theme and porto wasn't registered as virtual theme. In MySQL tabletheme
it should be of type 0 (psychical) and not 1 (virtual). There were various issues with themes because of it. magento.stackexchange.com/questions/92181/…
– obscure
Apr 17 '17 at 20:33
when I look in mysql in the theme table I see the parent theme is listed and is type zero. but the child theme is not listed.
– Jayreis
Apr 17 '17 at 20:47
add a comment |
Check if you're theme and porto wasn't registered as virtual theme. In MySQL tabletheme
it should be of type 0 (psychical) and not 1 (virtual). There were various issues with themes because of it. magento.stackexchange.com/questions/92181/…
– obscure
Apr 17 '17 at 20:33
when I look in mysql in the theme table I see the parent theme is listed and is type zero. but the child theme is not listed.
– Jayreis
Apr 17 '17 at 20:47
Check if you're theme and porto wasn't registered as virtual theme. In MySQL table
theme
it should be of type 0 (psychical) and not 1 (virtual). There were various issues with themes because of it. magento.stackexchange.com/questions/92181/…– obscure
Apr 17 '17 at 20:33
Check if you're theme and porto wasn't registered as virtual theme. In MySQL table
theme
it should be of type 0 (psychical) and not 1 (virtual). There were various issues with themes because of it. magento.stackexchange.com/questions/92181/…– obscure
Apr 17 '17 at 20:33
when I look in mysql in the theme table I see the parent theme is listed and is type zero. but the child theme is not listed.
– Jayreis
Apr 17 '17 at 20:47
when I look in mysql in the theme table I see the parent theme is listed and is type zero. but the child theme is not listed.
– Jayreis
Apr 17 '17 at 20:47
add a comment |
1 Answer
1
active
oldest
votes
Check if the path really exist and run these commands below to give permit to folders and do a deploy, if have some problem will show up with the description:
alias mage="php -d memory_limit=-1 -f bin/magento"
chmod -R 775 pub/static/ var/ pub/media/ &&
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/ ;
mage cache:clean &
mage cache:flush &
mage indexer:reindex &
mage setup:upgrade &&
mage setup:static-content:deploy -t Smartwave/porto_child
mage setup:db-data:upgrade &&
mage dev:source-theme:deploy &&
chmod -R 775 pub/static/ pub/media/ var/
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f170482%2fmagento-2-creating-a-child-theme%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Check if the path really exist and run these commands below to give permit to folders and do a deploy, if have some problem will show up with the description:
alias mage="php -d memory_limit=-1 -f bin/magento"
chmod -R 775 pub/static/ var/ pub/media/ &&
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/ ;
mage cache:clean &
mage cache:flush &
mage indexer:reindex &
mage setup:upgrade &&
mage setup:static-content:deploy -t Smartwave/porto_child
mage setup:db-data:upgrade &&
mage dev:source-theme:deploy &&
chmod -R 775 pub/static/ pub/media/ var/
add a comment |
Check if the path really exist and run these commands below to give permit to folders and do a deploy, if have some problem will show up with the description:
alias mage="php -d memory_limit=-1 -f bin/magento"
chmod -R 775 pub/static/ var/ pub/media/ &&
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/ ;
mage cache:clean &
mage cache:flush &
mage indexer:reindex &
mage setup:upgrade &&
mage setup:static-content:deploy -t Smartwave/porto_child
mage setup:db-data:upgrade &&
mage dev:source-theme:deploy &&
chmod -R 775 pub/static/ pub/media/ var/
add a comment |
Check if the path really exist and run these commands below to give permit to folders and do a deploy, if have some problem will show up with the description:
alias mage="php -d memory_limit=-1 -f bin/magento"
chmod -R 775 pub/static/ var/ pub/media/ &&
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/ ;
mage cache:clean &
mage cache:flush &
mage indexer:reindex &
mage setup:upgrade &&
mage setup:static-content:deploy -t Smartwave/porto_child
mage setup:db-data:upgrade &&
mage dev:source-theme:deploy &&
chmod -R 775 pub/static/ pub/media/ var/
Check if the path really exist and run these commands below to give permit to folders and do a deploy, if have some problem will show up with the description:
alias mage="php -d memory_limit=-1 -f bin/magento"
chmod -R 775 pub/static/ var/ pub/media/ &&
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/ ;
mage cache:clean &
mage cache:flush &
mage indexer:reindex &
mage setup:upgrade &&
mage setup:static-content:deploy -t Smartwave/porto_child
mage setup:db-data:upgrade &&
mage dev:source-theme:deploy &&
chmod -R 775 pub/static/ pub/media/ var/
answered Apr 17 '17 at 19:54
Rafael Corrêa GomesRafael Corrêa Gomes
4,28222962
4,28222962
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f170482%2fmagento-2-creating-a-child-theme%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Check if you're theme and porto wasn't registered as virtual theme. In MySQL table
theme
it should be of type 0 (psychical) and not 1 (virtual). There were various issues with themes because of it. magento.stackexchange.com/questions/92181/…– obscure
Apr 17 '17 at 20:33
when I look in mysql in the theme table I see the parent theme is listed and is type zero. but the child theme is not listed.
– Jayreis
Apr 17 '17 at 20:47