CSS File Problems

I notice under the wiki that the example shows the css file created as New File >> Files >> File i.e. a child file under the design but the manual states that css files should be created with New Child >> Design >> CSS File.


My problem is that if I upload a css file as a normal child file under the design it works and the styles are applied albeit you cannot edit the parse file. So, I choose instead (after reading the manual) to add a New Child >> Design >> CSS File and upload the associated .css file which is then editable as a parse file and associated image files referenced from the css file. However, when I preview pages PHP complains of "Undefined index" even though the css file is named correctly and the entire design is cascaded as Live…



In other words if the css file is created by New File >> Files >> File called styles.css everything works. However, if instead I use New Child >> Design >> CSS File called styles.css with an associated parse file called styles.css I get Undefined index on preview.



Am I missing something?

Yup. :slight_smile:


The CSS File asset needs to be linked using the linked_css design area (so that the replacements are handled correctly). Check the latest Design Manual for details on the linked_css design area and its syntax.



The normal style of mysource_files/styles.css will only work with File assets.

[quote]Yup. :slight_smile:


The CSS File asset needs to be linked using the linked_css design area (so that the replacements are handled correctly). Check the latest Design Manual for details on the linked_css design area and its syntax.



The normal style of mysource_files/styles.css will only work with File assets.

[right][post=“7626”]<{POST_SNAPBACK}>[/post][/right][/quote]



Will do and thanks for the speedy reply :slight_smile:

[quote]Yup. :slight_smile:


The CSS File asset needs to be linked using the linked_css design area (so that the replacements are handled correctly). Check the latest Design Manual for details on the linked_css design area and its syntax.



The normal style of mysource_files/styles.css will only work with File assets.

[right][post=“7626”]<{POST_SNAPBACK}>[/post][/right][/quote]



Ok, I’ve read that section of the design manual but that’s not working either.



I have placed the following code in my design’s parse file:


    
    
    
    
    
    


But it's made no difference. When I preview a page nothing appears between the styles comments.


I have four CSS Files created in this design:

styles.css, section_corporate.css, print.css and modern.css

What else do I have to do to get the above code to pick these styles up?

Cheers...John.

You need to create a Customisation of the design, customise the linked_css area to specify which CSS File asset to use and then apply the Customisation to the Site (instead of its parent Design asset).


If you just want the ability to edit the CSS in Matrix, its simpler just to upload a normal CSS file as a Text File asset (which can be edited in the Administration Interface). Remember to upload the file as a child of the Design.

[quote]You need to create a Customisation of the design, customise the linked_css area to specify which CSS File asset to use and then apply the Customisation to the Site (instead of its parent Design asset).


If you just want the ability to edit the CSS in Matrix, its simpler just to upload a normal CSS file as a Text File asset (which can be edited in the Administration Interface). Remember to upload the file as a child of the Design.

[right][post=“7635”]<{POST_SNAPBACK}>[/post][/right][/quote]





Hi Avi,



Can I specify multuple css assets using this method or just one?



Cheers…John.

[quote]Can I specify multuple css assets using this method or just one?
[right][post=“7637”]<{POST_SNAPBACK}>[/post][/right][/quote]



As many as you like, using either method. :slight_smile: If you use the linked_css to link to a CSS File asset, you need to create a design area for each CSS File you want to like.

Don't forget that you have to use different id's for the different CSS files.