I am simply trying to setup a Magento Theme which proves to be more difficult for me than i thought.
I created a template (simply the definition files as per documentation and a logo.svg).
I made my template to inherit from Luma (Magento/luma).
My Template shows up in the themes section and i set my theme to be used in the content section.
And then the shop suddenly looks like the Magento/blank theme...
Why is it not looking like the Luma theme although Magento correctly lists my theme as to have Luma as its parent? And why is my custom logo not displayed as it should be? So far my file structure only looks like (in app/design/frontent/Test/myTheme/)
composer.json
registration.php
theme.xml
web
css
style.css
images
logo.svg
theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>myTheme</title> <!-- your theme's name -->
<parent>Magento/luma</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
</theme>
Also the logo should be displayed but is not.
In the Magento application, the default format and name of a logo
image is logo.svg. When you put a logo.svg image in the conventional
location, which is /web/images directory, it is
automatically recognized as theme logo. It is displayed in your store
page header once the theme is applied.
(from: https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-create.html)
Btw: Megento CE 2.2.6
The caches are flushed and the new Theme settings are applied i.e. when i switch the theme.
Run these commands from CLI.
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
Related
I have upgraded my Magento 2 store from 2.2.9 to 2.4.2. There is 2 themes are active.
Theme One working for overall site. This theme is working fine. The parent theme for this is Blank Theme.
Theme Two is for particular category and product associated with that category. There is issue with this theme the layout is not rendering in frontend in product view page. The parent theme for this is Theme One.
Any one can help me to resolve this issue.
There would be many things, which is cause of not rendering theme in frontend. First check the permission of files "pub/static/frontend" folder, it should be folder 755 & files 644.
After, that check theme is applying correct or not from category.
Finally try below commands from SSH terminal in Magento root directory.
php bin/magento setup:upgrad
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
chmod -R 777 var/ pub/static/frontend
Magento 2.4.2 have many things changed e.g. in cms page xml layout box removed so may it happen. you can contact me on puneetk00#gmail.com. I will fix this issue.
[Please subscribe my Youtube channel] https://www.youtube.com/channel/UChb7DM9SspzrUVh4hnWL50A
I am new to Magento.
I am creating Magenta 2 site, I have managed to install Magento, and for it to use the luma theme.
I want to be able to edit the theme (through Inheritance), I understand it uses XML files to design the layout, how do I change these, should they be in the new theme folder, and change them there?
If so, where do I get the origonal Luma xml files, or does magento create these? - There are no themes within the app/ folder, is it here where I create the new theme (that inherits from Luma)?
Many thanks for any help, I am completely new to Magento.
You have to create a custom theme and make theme.xml and set a parent to LUMA.
Now app/design/frontend/customthemename
So anything that you want to customized used in customthemename folder
Thanks
You should create a child theme to edit XML file. To create a child theme, there are 3 steps to do:
Firstly, create a new theme directory in app/design/frontend.
Secondly, declare the new theme by:
Creating theme.xml: this file identifies the name, parent and other
basic info of the new theme.
Creating Composer.json: this file is used to install the theme via Composer later.
Creating registration.php: this file is required in any Magento 2 Extension
and Themes.
Creating static files directories: this folder is used to store CSS, JS, image files.
Creating logo folder: this folder contains files that determine the location and size of your new theme logo.
Thirdly, apply and configure theme in admin: - Run Upgrade Command. - Apply the theme. - Deploy.
For more detailed tutorial, go to Guide to create Magento 2 theme.
The original XML files of any module and themes are located in vendor/magento//view/frontend/layout, with the module_name is the module related to the XML file you want to edit.
For example, with homepage CMS, the XML file is located in vendor/magento/module-cms/view/frontend/layout
I am attempting to create my first Magento 2 theme.
I have created a new theme here:
/app/design/frontend/MyComp/MyTheme/
I copied the blank theme from /vendor/magento/theme-frontend-blank/ into MyTheme and then I created/edited various files, as per the instructions here.
In the Admin Panel I have gone into Stores > Configuration > Design and Ive set the theme to MyTheme.
However the front end it appears that my new theme isnt being used.
When I enable template path hints from the Admin Panel, the frontend shows that all the files are being got from here /vendor/magento/module-theme/view/frontend/templates/.
Can anyone explain why Magento 2 is ignoring my theme, and how I can fix this?
Many thanks in advance.
You were not configuring in the right place, and you did not run command after configuring.
After you create the theme, you have to configure in Admin: Admin > Content > Configuration > edit “Default Store view” http://prntscr.com/k5idnm, and choose your theme then select “Applied Theme”.
After that, run:
php bin/magento setup:static-content:deploy
php bin/magento cache:flush
If after that, the theme still did not display correctly, you can back-up and delete folder pub/static/frontend, then run 2 commands above again and press Ctrl + F5 in your theme tab in your browser.
Clear cache after you've changed theme, running command in console:
php bin/magento cache:flush
Also if there is no files in your theme, Magento will use theme fallback system.
I installed Magento 2 from the Magento site. I have activated the developer mode by
{project directory}>php bin/magento setup:mode:set developer
Then I have installed my custom theme and finally I deployed my static content by
{project directory}>php bin/magento setup:static-content:deploy
My problem is I have to delete pub/static directory and deploy static content every time to apply the css and javacript changes. The static content deploy process is slow and taking so much time that it is very frustrating. I develop something and have to deploy to get the change to be appeared. Even for very small change. Flushing cache is not helping. Any help would be appreciated. Thanks in advance.
The grunt jobs should be enough to run when you change css.
So you can run:
grunt exec
grunt less
Or with specified theme name:
grunt exec:theme_name
grunt less:theme_name
Check in the database in core_config_data table and disable minify fields so Magento doesn't minify css / js while you develop. You can use this SQL query to disable those fields:
update core_config_data set value=0 where path in ('dev/css/minify_files', 'dev/css/merge_css_files', 'dev/js/minify_files', 'dev/js/merge_files')
On other pages of websites the css path is
http://xxx/magento_raw/skin/frontend/rwd/default/css/styles.css
But on product page it is
http://xxx/magento_raw/skin/frontend/base/default/css/styles.css
Why magento is taking css from base folder on product page.
Go to: Settings -> Configuration - General -> Design then set the Design Tab accordingly to your theme.
please use this code
your theme/layout/etc/theme.xml
<theme>
<parent>yourtheme/default</parent>
</theme>
use your theme name than it will access css file from your theme...