Recently I've been using the ccs_path (http://manuals.matrix.squizsuite.net/designs/chapters/global-variables#css-path) to specify my CSS files within Design assets and I have been getting mixed results and thought it was just me doing something wrong but it seems to be something in the system causing conflicts.
I have a Design asset with two CSS Design Files (not CSS file type assets) underneath, then the following code in the Design parse file:
<html> <head> <link rel="stylesheet" href="<MySource_PRINT id_name="__global__" var="css_path" filename="one.css" />"> <link rel="stylesheet" href="<MySource_PRINT id_name="__global__" var="css_path" filename="two.css" />"> </head> <body> <MySource_AREA id_name="page_body" design_area="body" /> </body> </html>
This produced the following error in the Log Manager:
(/data/private/assets/design_customisation/0007/488095/design_file.php:73) - Undefined index: one.css(/data/private/assets/design_customisation/0007/488095/design_file.php:40) - Undefined index: two.css
Needless to say the front end didn't show the CSS applied to the site as the source code looks like:
Even using the following doesn't seem to work:
<link rel="stylesheet" href="mysource_files/one.css"> <link rel="stylesheet" href="mysource_files/two.css">
I've checked to ensure that the CSS assets do have the correct web paths. All CSS files have content within. All assets related are Live with Public Read.
The odd part is I have some Designs working with multiple CSS Design File assets using the css_path variable and both get printed in the source code as expected, however there are also some Designs where only the first CSS reference will work. Investigating a little I thought it may have been due to creating Customisations then adding in a new CSS file later on, but it seems to be caused from the CSS Design File assets not being listed on the Dependants screen of the Design asset. This makes sense that the error should show since in the eyes of the Design there is no file to be referenced. I've tried creating the CSS assets before and after placing any content within the Design parse file but this doesn't seem to have any impact on the outcome.
So the question is: how do I consistently get CSS Design File assets to be usable with the css_path variable? Or rather, why won't they show on the Dependants screen? Is it intended that CSS Design File assets should never actually be dependants and the working examples I have are the real bug?
Using Matrix 4.10.2.