For instance can I have an upload field and (as long as the file is the right size) have it be the background of a DIV in one of my stylesheets? Is this possible?
Kenny who I work with at Xeed has done a solution to this before where the image is in the CSS file but he is currently on holiday, but I will try to remember to ask him when he is back.
Seems a bit hacky, making the content tree messier, another http request and potentially open to breakage from editors just to avoid a single inline style. +1 for sebastien and warren's solutions!
I'm not usually a fan of inline styles either, but sometimes they are the lesser of two evils.
The intention is that it should be made in a sperate tree so you have a structure like the following:
Content
- Homepage
- Subpage 1
- Subpage 2
- Settings
- Stylesheets
- Stylesheet
Under settings it is intended to make a stylesheets folder where you can create the stylesheet. I can't see what is messy about that to be honest. Content editors should off course not have access to the settings part.
I know that it seems like a lot of work to avoid a single inline stylesheet but what if suddenly you need to generate more stylesheet declarations than just one?
If people are using the compression package, which is made by Peter, I guess that it would all be wrapped into one single file and then I can't really see the problem :)
Can I call a Page Field Inside a CSS File?
For instance can I have an upload field and (as long as the file is the right size) have it be the background of a DIV in one of my stylesheets? Is this possible?
You could just write some CSS in the page:
By default I don't think it is possible to do this in the CSS file itself.
Sorry, not in the page, but the XSLT.
Why is there still no "edit" button in the forum?
Ok I am not a fan of inline CSS, not a big deal if it can not be done, just an idea. Didn't think it could work...
Well the simpliest way is that you could have an inline stylesheet in your head section is the easiest way but not the nicest code.
For example
Kenny who I work with at Xeed has done a solution to this before where the image is in the CSS file but he is currently on holiday, but I will try to remember to ask him when he is back.
Seems like alot of us working on this at the same time ;)
I think that will require that you somehow make a documenttype with a template in, which the template acts as a css file.
Then you would have to reference the dynamically created CSS file in your master-template to make use of it.
I think that it should be possible.
I would do the following
1: Create a document type and a template called stylesheet in the Settings section
2: In the content section define a placeholder (an empty document type) called "stylesheets"
3: Define my stylesheet and like this
3: Under the "Stylesheets" placeholder I would create my stylesheet and publish it
4: Then either make a XSLT macro to retrieve the image, which should be inserted into the stylesheet in the url().
5: Reference the stylesheet in the <head> of my master template
Please let me know if it is working out.
Seems a bit hacky, making the content tree messier, another http request and potentially open to breakage from editors just to avoid a single inline style. +1 for sebastien and warren's solutions!
I'm not usually a fan of inline styles either, but sometimes they are the lesser of two evils.
The intention is that it should be made in a sperate tree so you have a structure like the following:
Content
- Homepage
- Subpage 1
- Subpage 2
- Settings
- Stylesheets
- Stylesheet
Under settings it is intended to make a stylesheets folder where you can create the stylesheet. I can't see what is messy about that to be honest. Content editors should off course not have access to the settings part.
I know that it seems like a lot of work to avoid a single inline stylesheet but what if suddenly you need to generate more stylesheet declarations than just one?
If people are using the compression package, which is made by Peter, I guess that it would all be wrapped into one single file and then I can't really see the problem :)
is working on a reply...