Skip to main content
added 399 characters in body
Source Link
Shawn Abramson
  • 3.6k
  • 1
  • 17
  • 22

You do not have to create two of the same css files. However, you would need to use layout xml for both frontend and adminhtml, but it can be the same css file. For best results, store your file in the js folder, not the skin folder.

In the node you have above, use js_css as the type and then you can actually place CSS files in the js directory.

For example:

<action method="addItem"><type>js_css</type><name>some/dir/example.css</name></action>

Take note of the "type" node. js_css means that it is a css file that lives in the main js directory. The main js directory is not limited to area such as "adminhtml" or "frontend". The actual location of the css file is js/some/dir/example.css

I should note that this little nuance has actually been addressed in Magento 2. However, for M1, you will need to reference the file separately in your layout xml files.

However, now that I think of it, you can create a global observer that adds the file to both frontend and adminhtml.

You do not have to create two of the same css files. However, you would need to use layout xml for both frontend and adminhtml, but it can be the same css file. For best results, store your file in the js folder, not the skin folder.

In the node you have above, use js_css as the type and then you can actually place CSS files in the js directory.

I should note that this little nuance has actually been addressed in Magento 2. However, for M1, you will need to reference the file separately in your layout xml files.

However, now that I think of it, you can create a global observer that adds the file to both frontend and adminhtml.

You do not have to create two of the same css files. However, you would need to use layout xml for both frontend and adminhtml, but it can be the same css file. For best results, store your file in the js folder, not the skin folder.

In the node you have above, use js_css as the type and then you can actually place CSS files in the js directory.

For example:

<action method="addItem"><type>js_css</type><name>some/dir/example.css</name></action>

Take note of the "type" node. js_css means that it is a css file that lives in the main js directory. The main js directory is not limited to area such as "adminhtml" or "frontend". The actual location of the css file is js/some/dir/example.css

I should note that this little nuance has actually been addressed in Magento 2. However, for M1, you will need to reference the file separately in your layout xml files.

However, now that I think of it, you can create a global observer that adds the file to both frontend and adminhtml.

added 117 characters in body
Source Link
Shawn Abramson
  • 3.6k
  • 1
  • 17
  • 22

You do not have to create two of the same jscss files. However, you would need to use layout xml for both frontend and adminhtml, but it can be the same jscss file. For best results, store your file in the js folder, not the skin folder.

In the node you have above, use js_css as the type and then you can actually place CSS files in the js directory.

I should note that this little nuance has actually been addressed in Magento 2. However, for M1, you will need to reference the file separately in your layout xml files.

However, now that I think of it, you can create a global observer that adds the file to both frontend and adminhtml.

You do not have to create two of the same js files. However, you would need to use layout xml for both frontend and adminhtml, but it can be the same js file. For best results, store your file in the js folder, not the skin folder.

I should note that this little nuance has actually been addressed in Magento 2. However, for M1, you will need to reference the file separately in your layout xml files.

However, now that I think of it, you can create a global observer that adds the file to both frontend and adminhtml.

You do not have to create two of the same css files. However, you would need to use layout xml for both frontend and adminhtml, but it can be the same css file. For best results, store your file in the js folder, not the skin folder.

In the node you have above, use js_css as the type and then you can actually place CSS files in the js directory.

I should note that this little nuance has actually been addressed in Magento 2. However, for M1, you will need to reference the file separately in your layout xml files.

However, now that I think of it, you can create a global observer that adds the file to both frontend and adminhtml.

Source Link
Shawn Abramson
  • 3.6k
  • 1
  • 17
  • 22

You do not have to create two of the same js files. However, you would need to use layout xml for both frontend and adminhtml, but it can be the same js file. For best results, store your file in the js folder, not the skin folder.

I should note that this little nuance has actually been addressed in Magento 2. However, for M1, you will need to reference the file separately in your layout xml files.

However, now that I think of it, you can create a global observer that adds the file to both frontend and adminhtml.