1

I have html / css template I created weeks ago, and I want to apply these HTML / CSS to magento? how can I do that? I already copied the blank theme to make modifications on it. When I accepted the job, I didn't expect Magento to use XML for its layouts.

I don't want to use the default Magento 2 html structure, I have my own bootstrap / css / html conventions. So I want to change the whole structure (head tag, body tag), and use *.css instead of *.less files. I just want it simple.. I'll care about Magento conventions later.

I never worked with Magento, and I don't understand these xml files. My boss wanted Magento, and I have to do it in 2 weeks (one week has already passed, trying to understand the documentation).

Magento doesn't pity newcomers

Thank you.

2

I do not know of any way to bypass standard theming layer to be honoest, so my only advice would be to learn it.

A good thing to start off doing is extending an existing theme and use layout xmls to remove everything then add it back in and modify the corresponding templates according to your bootstrap markup.

You need to check some general theming resources:

http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-create.html

http://blog.magestore.com/how-to-create-custom-theme-on-magento-2-part-1/

Also check other threads: How to create theme in magento 2 stable version?

Note that many guides where created before release so things might have changed.

Removing a block is done like this:

<referenceBlock name="messages" remove="true"/>

This is how default_head_blocks.xml looks in my theme:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="css/app.css" />
    <css src="css/foundation-icons/foundation-icons.css" />
</head>

This tells magento2 to add these css files to head.

I hope this might help you get started.

  • Thank you brother, So you mean I have to use that line <referenceBlock name="messages" remove="true"/> for every block and container? – SmootQ Feb 1 '16 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.