Hi all,

is it possible to access cms content in css files? I have tried something like that:

.info {
    color: "#{ivy.cms.co('/Layouts/color/info')}"
}

Thank you

asked 30.12.2015 at 08:50

Florian%20Heinrich's gravatar image

Florian Hein...
(suspended)
accept rate: 0%


Yes I tried your example and it worked for me. The css must be included in the xhtml like this:

...
<h:outputStylesheet name="styles/styles.css" />
...

For the sample css include above the css file would be located in the project under: webContent/styles/styles.css

But to get a correct color value in css you have to remove the " around the expression like this:

.info {
    color: #{ivy.cms.co('/Layouts/color/info')}
}
link

answered 30.12.2015 at 09:02

Christian%20Strebel's gravatar image

Christian St... ♦
3.2k31338
accept rate: 88%

edited 30.12.2015 at 12:14

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×26
×4

Asked: 30.12.2015 at 08:50

Seen: 1,991 times

Last updated: 30.12.2015 at 12:14