Solved

using cfif in .cfm stylesheet

Posted on 2010-09-01
7
495 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reverse Proxy Server 6 82
ip / url redirect 13 71
ColdFusion Why is my CF search engine slow on one of my servers? 4 36
WebSite Direction 1 41
The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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