Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

using cfif in .cfm stylesheet

Posted on 2010-09-01
7
Medium Priority
?
512 Views
Last Modified: 2013-12-24
using this in my main.cfm stylesheet - no errors until i add the if logic:
<cfcontent  type="text/css" >
#contentBG{/*this will be db or cfm if logic driven*/
float:left;
width:960px;
background:<cfif crumb IS "home">#85a3c2;</cfif>
min-height:500px;
}
</cfcontent>

when I add the above if logic to the stylesheet my stylesheet turns in to this:

#contentBG{/*this will be db or cfm if logic driven*/

float:left;

width:960px;

background: <!-- " ---></TD></TD></TD></TH></TH></TH></TR></TR></TR></TABLE></TABLE></TABLE></A>

this is at the top of the page that is calling the stylesheet:
<cfset crumb="home">

0
Comment
Question by:phillystyle123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 36

Expert Comment

by:SidFishes
ID: 33579596
probably just need to escape your #

<cfcontent  type="text/css" >
##contentBG{/*this will be db or cfm if logic driven*/
float:left;
width:960px;
background:<cfif crumb IS "home">##85a3c2;</cfif>
min-height:500px;
}
</cfcontent>
0
 

Author Comment

by:phillystyle123
ID: 33579687
I'm still getting this in my css:

##contentBG{/*this will be db or cfm if logic driven*/

float:left;

width:960px;

background: <!-- " ---></TD></TD></TD></TH></TH></TH></TR></TR></TR></TABLE></TABLE></TABLE></A></ABBREV></ACRONYM></ADDRESS></APPLET></AU></B></BANNER></BIG></BLINK></BLOCKQUOTE></BQ></CAPTION></CENTER></CITE></CODE></COMMENT></DEL></DFN></DIR></DIV></DL></EM></FIG></FN></FONT></FORM></FRAME></FRAMESET></H1></H2></H3></H4></H5></H6></HEAD></I></INS></KBD></LISTING></MAP></MARQUEE></MENU></MULTICOL></NOBR></NOFRAMES></NOSCRIPT></NOTE></OL></P></PARAM></PERSON></PLAINTEXT></PRE></Q></S></SAMP></SCRIPT></SELECT></SMALL></STRIKE></STRONG></SUB></SUP></TABLE></TD></TEXTAREA></TH></TITLE></TR></TT></U></UL></VAR></WBR></XMP>

0
 
LVL 19

Assisted Solution

by:Bhavesh Shah
Bhavesh Shah earned 600 total points
ID: 33579720

There should be an error behind this.
check out.
some variable is not  defined or  some run time error.
0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 

Author Comment

by:phillystyle123
ID: 33579863
ah yes -

Variable CRUMB is undefined.

i've got this at the very top of the page that's calling the css:

<cfset crumb="home">

am i doing something wrong?

0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 33579898
can u pls post ur full code
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 1400 total points
ID: 33579956
>> this is at the top of the page that is calling the stylesheet:

How are you "calling" the stylesheet?  If you're using <link href="...">, that error would make sense. IIRC, variables declared on the parent page aren't available to a <link>'d page.  You'd have any variables in the URL:

    ie
    <link href="yourStyleSheet.cfm?crumb=something" type="text/css" />

But using a .cfm file and <link> isn't real common ;-) So I may be way off target ...
0
 

Author Closing Comment

by:phillystyle123
ID: 33580511
thanks! finding the error in the css and:



did the trick
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question