Solved

using cfif in .cfm stylesheet

Posted on 2010-09-01
7
491 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

929 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

6 Experts available now in Live!

Get 1:1 Help Now