Magento 2 ignoring new theme - magento

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.

Related

Issue with custom theme after upgrade from Magento 2.2.9 to Magento 2.4.2

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

Problems setting up a Magento Theme

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

Changes to CSS and JavaScript applies only after deploying static content

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')

How can I install new theme in Magneto ?

I want to install new theme in magento and I have also followed step of this link (https://www.siteground.com/tutorials/magento/magento_themes.htm) but I am not abling to get theme in magento. Please suggest me how can I install theme in magento ?
Thanks
If you already have the pre-built theme, then in magento project folder navigate to
app/design/frontend/default
Place your theme folder here.
Now to activate your theme. Log in to your admin panel.
Navigate to
system->configuration
Click in the design tab in the left hand side
Under the "Pakage Name" put you package name i.e "default" in this case and under you theme In the "Template" put your theme name "Your_theme_name" i.e your theme folder name that you copied inside default directory.
If you are creating a new theme, just create a new folder inside default directory and follow the step as described above.
In this way you can install a new theme.
Hope this will help.
It depends how theme you want to use is distributed. If it is a package, just extract it to your root folder and you should get proper folders in skin and app/design dirs and what you need to do then is to set correct package and / or theme in backend (Configuration > Web > Design). For full package theme name would probably always be default. Although if you are only adding new theme, you should pick its name app/design/frontend/default/{theme_name} and same in skin folder (if it includes some additional css, images and / or javascript).

How do I prepare fresh magento install (ver. 1.8.1) for local theme developement?

Just installed a fresh copy of Magento and I would like to know what settings/configurations have to be made in order to begin theme development. I'm running php 5.4 on a mac and for coding the theme I will use SCSS.
You have to create a new theme folder and theme package folder (optional) as followig
app/design/frontend/{theme package name}/{theme folder name}/
then create two folders layout and template and work in them.
Then create the skin related folders in skin/frontend/{theme package name}/{theme folder name}/ and place all your theme related css and images here.
Note that you have to keep the theme package name same for both.
To activate this theme on the site, log-in to your admin panel, go to
system >> configurations >> Design and click the Package Tab and enter your theme package name then open the Theme tab beneath it and enter the Template, Skin and layout theme folder names, if the theme folder name is same for all of them then just enter it in the Default field and leave others empty and save the settings. Now clear the site Cache by going to system >> Cache Management, select all the options and click Submit button and reload the frontend. The new theme will be in action.

Resources