CSS File Asset

I have added a new design and then attached the images to the design. I then created a CSS File Asset. How do i get the design i created to use this CSS file??

Sorry i got it working.


I should resd the Design Manual First.



Cheers

Unless you need advanced dynamic CSS (created on the fly), you shouldn't use the CSS File asset. Rather you should just upload a plain CSS file as an associated file of the design, just like you add an image. This way, the CSS file will be cachable by the end-user.

Avi,


The above point I think is REALLY important to all users and people should know that using a CSS File asset should only be done under exceptional circumstances.



For all those unaware of what Avi is referring to (and correct me if Im wrong Avi) is that your CSS file asset will be downloaded to the clients computer every time they request a page that references it. Normal CSS files generally cache on the clients computer so it only has to be downloaded once, but CSS File assets dont. This could have a significant impact on the speed of your site.



Now, after mentioning that, it seems to me that you can only choose CSS File assets when you use a CSS design area



ie



<MySource_AREA id_name="css" design_area="linked_css">

<MySource_SET name="tag_type" value="link_tag" />

<MySource_SET name="media" value="all" />

</MySource_AREA>



it only gives you options to link to CSS File assets. Am I missing something?



Steve.

That design area is used to link a CSS File asset to a Design. You can then use any of the normal design areas within the CSS File asset's parsefile as well (including the mysource_files/ virtual location). In this way, you could use the menu design areas to create auto-generated CSS automatically.

I think you may have missunderstood the point I was trying to make.


The point is CSS Files are not cached so I dont want to use them…ever.



But I would like to use the CSS design area to point to my associated CSS files. That way if the CSS file was not published it would use a particular url and if it was published it would use the "__data" url.



Steve.

The mysource_files/ virtual location will do that automatically. Just reference the associated CSS file like so:


<link rel="stylesheet" href="mysource_files/styles.css" />



Matrix will automatically insert the correct URL based on the asset status and permission.