Solved

using cfif in .cfm stylesheet

Posted on 2010-09-01
7
498 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
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 150 total points
ID: 33579720

There should be an error behind this.
check out.
some variable is not  defined or  some run time error.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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 350 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Comparing 2 Lists Coldfusion 8 54
Setting Up Local Lan Web Server 1 64
REGEX HELP 11 48
ColdFusion 9 CF Administrator and Request Filtering 3 26
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…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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