I have a design made. I want to keep the CSS seperate to stay modular. I've created a CSS asset but I don't know how to attach that asset to the design. Also, can you attach a CSS asset to an individual page or site (alongside a design)?
You use the Linked CSS design area to attach a CSS file to a design. Within your Design parsefile, add the following:
Then, you need to create a Design Customisation (or modify an existing customisation) and select which CSS asset to link to. By using multiple customisations, you can select different CSS assets for each customisation. You can then apply a different customisation to individual pages or sites.
Ok, I'm a bit lost. I am very new to Mysource(about 4 days new). I'm slowly understanding things via the manual and these forums. Could you give me step-by-step instructions on how to do this? Assume I already have a Design Asset and that asset is already attached to a site. Also assume I have a CSS file locally (not on mysource yet). Assume only those things. How do I Create a CSS Asset and how do I attach that to my Design Asset?
Thanks. And sorry for my slow-ness on picking this up.
That's OK.
The CSS asset is used to create dynamic CSS. If you have a static CSS file (i.e. one that you don't want to change during runtime), you can just upload it as an associated file of the design (like any images) on the details page of your design and refer to it within your design like to:
[html]<link rel="stylesheet" type="text/css" href="mysource_files/styles.css" />[/html]
Obviously replacing "styles.css" with the name of your stylesheet. You could also use an @import url(mysource_files/styles.css); call, if you prefer.
To use a different CSS file for different sections of your site, you can create Design Customisations and upload a different CSS file for each customisation. Then, you attached the Customisation as the Design for either a site (or part of one – you can set a design at any level in Matrix and it automatically cascades down the tree).
The CSS asset is used to create a CSS file that changes while Matrix is running, or is customised for various parts of the site. I would recommend waiting until you've worked with a few designs (and design customisations) before trying to add CSS assets to the whole mix. It can be quite confusing. 
[quote]If you have a static CSS file (i.e. one that you don't want to change during runtime), you can just upload it as an associated file of the design (like any images) on the details page of your design and refer to it within your design like to:
[html]<link rel="stylesheet" type="text/css" href="mysource_files/styles.css" />[/html]
Obviously replacing "styles.css" with the name of your stylesheet. You could also use an @import url(mysource_files/styles.css); call, if you prefer.[/quote]
Ya, I was doing that…I wanted something a little more modular though (I like the idea of customisations).
[quote]To use a different CSS file for different sections of your site, you can create Design Customisations and upload a different CSS file for each customisation. Then, you attached the Customisation as the Design for either a site (or part of one – you can set a design at any level in Matrix and it automatically cascades down the tree).[/quote]
I think I'll do it this way. I like the idea of different portions of the site having the ability to have custom designs that are "decendents" of the base design.
[quote]The CSS asset is used to create a CSS file that changes while Matrix is running, or is customised for various parts of the site. I would recommend waiting until you've worked with a few designs (and design customisations) before trying to add CSS assets to the whole mix. It can be quite confusing. smile.gif[/quote]
This could be of use to me later on. Is there any documentation on how to use the CSS asset? I've looked but could not find any.
As a side note, I'm looking into this for the possible use as a CMS for severl departments within State Government. So far this is the most promising Open Source CMS I've found out there. You guys do a great job. If there were one thing I would have to complain about however is incomplete documentation. I trust you guys are working on completing that however B)
We are actively working on our documentation. We hope to have the entire documentation set updated for RC2 by the time we release RC3. <grin> Seriously though, this quater's performance target is pretty much all documentation based, so I'm sure we'll be seeing great improvements over the next few months.
Hey Avi - Is this all working as expected now? I seem to remember some glitches - of course it could be my style sheets causing that!
The CSS assets are fine, CSS customisations are still a little iffy. 
Define "iffy". I would like to know if I run into a problem if it's my fault or if it's a bug.
CSS Customisations should not currently be used. 
Sorry, I thought you were talking about Design Customisations. You had me confused there for a few minutes… Use Customizations…but they shouldn't be used…they are a bit "iffy" I think I have it all figured out now…
BTW, I have a design customization set up using an uploaded css file. The only problem I'm having now is that images associated to my css file are not being seen. in the css file I access the images via mysource_files/ I have the images uploaded in my customization and they are public read and they are live. But no luck. <_<
Nope. Static CSS files can't access the mysource_files/ virtual location (which is the main reason the CSS File asset was created). You have two choices:
- Work out what the Live/Public Read URL of each image is and then hard-code that into the static CSS file.
- Use a CSS File asset with mysource_files/ and attached images. The CSS File asset should exist in your site (not as a child of the design). The images you want to link to the CSS File asset need to be uploaded as Associated Files (just like with a design).
Talking about customizations - Is there any progress on giving customizations a HIPO job?
Work on the Design HIPO is in progress. We'll know more when Greg gets back from the UK.
The design HIPO was completed but did not solve any problems to do with memory limits. Designs and how they are parsed will probably have to be re-thought for any significant improvements to be possible with a HIPO. You should consider this not complete.
Hi,
I seem to have an issue with the use of CSS assets.
In my design (parse file) I have the following:
I then created a customisation and two CSS File assets.
Within the customisation, i have linked the CSS File assets to the customisation.
The output however is as follow:
Hope someone can help me.
Cheers.
Try moving the actual CSS asset underneath the site asset somewhere so that it picks up an explicit URL from the site. Once it has an explicit url it should continue showing up.
Ace. Thanks, works like a charm.
It does make sense but isn't really obvious.
Maybe one for the RC2 doco when it comes out…
Were the CSS assets children of the Design or the Customisation? If they're children of the customisation, they should pick up a URL once the customisation is linked to a site.
Nope, they weren't children.
I just tried it:
- Moved the customisation folder (containing customisation and the 2 CSS asset) out of the site.
- The URL were empty again (expected).
- Moved the CSS asset under the customisation.
- The URL were working.
Thanks a lot for that.