Solved

using cfif in .cfm stylesheet

Posted on 2010-09-01
7
488 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
7 Comments
 
LVL 36

Expert Comment

by:SidFishes
Comment Utility
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
Comment Utility
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 150 total points
Comment Utility

There should be an error behind this.
check out.
some variable is not  defined or  some run time error.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:phillystyle123
Comment Utility
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
Comment Utility
can u pls post ur full code
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 350 total points
Comment Utility
>> 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
Comment Utility
thanks! finding the error in the css and:



did the trick
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now