Skip to content

Inherit from Luma - Functionality issues. #3220

@cvpportraits

Description

@cvpportraits

Hi, first I wanted to state that I was told luma wasn't meant to be used in production... but... it is a great starting point and would love to use it as a base, so...

new Magento2 installation, went through a whole series of learning where I could not figure out why my default head blocks xml wasn't working to load my custom css/js files... as per the new theme in the documentation.

After re-going over the code, there was nothing wrong... by trial & error,

I figured out that if I made my new theme inherit from magento/blank, then my custom css & js would load... but if I inherit from magento/luma, it would not... so... my question is HOW can I use the Luma theme and then just modify it to suit needs, it's a great starting point, and would cut out weeks of development if we could use this.

So, I created a new theme, and inherited from luma...

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> <title>CVPStyle4</title> <parent>Magento/luma</parent> <media> <preview_image>media/preview.jpg</preview_image> </media> </theme>

hen I go and regenerate static files via deploy, and my theme is in the backend, and I activate it and it looks like luma, but it does NOT load my custom css/js files, or anything in the default_head_blocks.xml

inside: app > design > frontend > myvendor > mytheme > Magento_Theme > layout

and here's my code in that xml:

`

<!--Before-After Script-->
<link src="js/jquery.twentytwenty.js"/>
<link src="js/jquery.event.move.js"/>

<!--Font Awesome-->
<css src="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" src_type="url" />`

and no matter how I do it, it will not load and work.

How can I inherit from luma and add some css/js to customize it?
note

I have tried copying the entire luma theme from:

vendor > magento > theme-frontend-luma and then changing the name and such in composer.json, registration.php, and theme.xml - theme sort of loads, (doesn't look quite right) - and STILL won't load any custom CSS/JS from the default_head_blocks.xml

any thoughts? I'd really like to use luma as a base. Thank
(I have a stackexchange request for help too, but there seems to be not many people there)

really hoping someone can help with this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions