Properly calling CSS in RD

29 views
Skip to first unread message

Dave R

unread,
Jan 20, 2010, 4:23:47 PM1/20/10
to RedDot CMS Users
I haven't had to do this yet, but I will soon.

Reddot changed how CSS is handled sometime around Reddot 9 and
certainly 10. They wanted us to call it in through a different element
I think so that it can be properly rendered in 10 and non-ie browsers.

Do any of you remember how it's supposed to be done now?

We actually develop/host the css as content classes in our projects so
we can easily edit them and pull in images from the asset manager. So
I have css "pages" that are connected to anchors.

Any ideas? Things are looking a bit rough on our dev box for 10.

Mark Radford

unread,
Jan 21, 2010, 9:56:02 AM1/21/10
to RedDot CMS Users
Using "pages" to do your CSS files (so you can link to anchor elements
and so on) is the right idea, I think. I've recently been on official
reddot (Sorry - Open Text WS) training and this is how we were shown
to implement CSS files in the templates:

<reddot:cms>
<if>
<query valuea="Context:CurrentRenderMode" operator="=="
valueb="Int:2">
<htmltext>
<!-- This is the published mode -->
<!-- Add your normal links to CSS files as you would normally -->

<link rel="stylesheet" type="text/css" href="<%anc_cssfile%>" />

</htmltext>
</query>
<query type="else">
<htmltext>
<!-- This is RedDot and preview modes -->
<!-- Add your CSS as a container so that it goes straight into the
page -->

<style type="text/css">
<%con_cssfile%>
</style>

</htmltext>
</query>
</if>
</reddot:cms>

Then all you need to do is reference your anchor to your template so
that it pulls your CSS file straight in and you're done.

I used to do this the same way, but used blockmarks to determine
whether or not I was in smartedit or not. This way means your preview
and publish can be differentiated against, which is useful.

I'm not sure what you mean about the CSS elements?

Hope that helps.

Mark

kimdezen

unread,
Jan 24, 2010, 7:23:03 PM1/24/10
to RedDot CMS Users

Dave R

unread,
Jan 26, 2010, 4:54:47 PM1/26/10
to RedDot CMS Users
Thanks. I'll look into that later this week I hope.

Dave

Dave R

unread,
Jan 27, 2010, 12:37:45 PM1/27/10
to RedDot CMS Users
Yes... that solution worked perfectly Mark. Thanks.

markus giesen

unread,
Feb 8, 2010, 6:10:57 PM2/8/10
to RedDot CMS Users
A best practice: keep it outside of cms
http://bit.ly/bjYJwL

On 21 Jan., 08:23, Dave R <redsav...@earthlink.net> wrote:
> I haven't had to do this yet, but I will soon.
>

> Reddot changed howCSSis handled sometime around Reddot 9 and


> certainly 10. They wanted us to call it in through a different element
> I think so that it can be properly rendered in 10 and non-ie browsers.
>
> Do any of you remember how it's supposed to be done now?
>

> We actually develop/host thecssas content classes in our projects so


> we can easily edit them and pull in images from the asset manager. So

> I havecss"pages" that are connected to anchors.

Udo.Baldewein

unread,
Feb 17, 2010, 12:19:51 PM2/17/10
to RedDot CMS Users
Hi Mark,

it's a nice job, but I have another workarround for you.

The Problem is the SmartEdit Mode. Preview and Publishing are okay.

If you want to have a css file in a reddot content class like version
9, you can do that by using this one.

Open Text Management Server 10 render the content class and ist
searching for <html><head> and <body>.
If it cant find them, the server includes it automaticly. But if OTWS
find the tags, they will be used.

The solution:

Put in your css content class something like this:

/*
<!--
<html>
<head>
<!--
</head>
<body>
</body>
</html>
-->
*/

@charset "utf-8";
/* Udo Baldewein - Internet Solutions - www.udo-baldewein.de */
html {
margin:0;
padding:0;
height:100%;
background-image:url(<%img_bg_oben_jpg%>);
background-repeat: no-repeat;
background-position: top ......
...............

CMS render the css content class and the output is like this:

/*
<!--
<html>
<head><!-- PageID 4 - published by Open Text Web Solutions 10 -
10.0.0.57 - 11686 -->
<!--
</head>
<body ONLOAD="RDCheckLinkTargets();" ><script language="javascript">
function RDCheckLinkTargets()
{ for (var i = 0; i < document.links.length; i++)
{
var sTarget = document.links[i].target;
if (sTarget == "_blank" || sTarget == "_parent" || sTarget ==
"_top")
document.links[i].target = "_self";
}
}
</script>
</body>
</html>
-->
*/

@charset "utf-8";
/* Udo Baldewein - Internet Solutions - www.udo-baldewein.de */
html {
margin:0;
padding:0;
height:100%;
................

That my way to use an anchor for css files.

maybe not very nice - but this is a workarround

Hope that helps

Udo

On 21 Jan., 15:56, Mark Radford <markradf...@gmail.com> wrote:
> Using "pages" to do yourCSSfiles (so you can link to anchor elements


> and so on) is the right idea, I think.  I've recently been on official
> reddot (Sorry - Open Text WS) training and this is how we were shown

> to implementCSSfiles in the templates:


>
> <reddot:cms>
>     <if>
>         <query valuea="Context:CurrentRenderMode" operator="=="
> valueb="Int:2">
>             <htmltext>
> <!-- This is the published mode -->

> <!-- Add your normal links toCSSfiles as you would normally -->


>
> <link rel="stylesheet" type="text/css" href="<%anc_cssfile%>" />
>
>              </htmltext>
>         </query>
>         <query type="else">
>             <htmltext>
> <!-- This is RedDot and preview modes -->

> <!-- Add yourCSSas a container so that it goes straight into the


> page -->
>
> <style type="text/css">
> <%con_cssfile%>
> </style>
>
>             </htmltext>
>         </query>
>     </if>
> </reddot:cms>
>
> Then all you need to do is reference your anchor to your template so

> that it pulls yourCSSfile straight in and you're done.


>
> I used to do this the same way, but used blockmarks to determine
> whether or not I was in smartedit or not.  This way means your preview
> and publish can be differentiated against, which is useful.
>
> I'm not sure what you mean about theCSSelements?
>
> Hope that helps.
>
> Mark
>
> On Jan 20, 9:23 pm, Dave R <redsav...@earthlink.net> wrote:
>
>
>
> > I haven't had to do this yet, but I will soon.
>

> > Reddot changed howCSSis handled sometime around Reddot 9 and


> > certainly 10. They wanted us to call it in through a different element
> > I think so that it can be properly rendered in 10 and non-ie browsers.
>
> > Do any of you remember how it's supposed to be done now?
>

> > We actually develop/host thecssas content classes in our projects so


> > we can easily edit them and pull in images from the asset manager. So

> > I havecss"pages" that are connected to anchors.
>
> > Any ideas? Things are looking a bit rough on our dev box for 10.- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Reply all
Reply to author
Forward
0 new messages