On Apr 13, 2004, at 1:07 PM, Joy Holman wrote:

> Here's where the styles comes in:
>  I have a CSS stylesheet with these values:
>  #FellSvc{display:none;}
>  #MinorRts{display:none;}
>  #AmnInf{display:none;}
>  #AnteSter{display:none;}
>
>  In the db table, I have a column for the same styles from the
> stylesheet. Let's say the column name is "linkStyle" (like your
> example). Another column in the db table has the text for the menu
> link that displays on the page.
>
>  When a user clicks on a menu link (generated by the CF code prior to
> the user interaction), an assoicated DIV with an ID equal to the
> stylename displays its content because the onClick event tells the
> matching style in the stylesheet to change "display=none" to
> "display=block".
>
>  Using your example, just change the end to something like this:
>  >Now, iterating over the query:
>  >
>  ><cfoutput query=menu>
>  ><br><a href=""
> #linkName# </a>
>  ></cfoutput>
>
>  Now, that doesn't work because #linkStyle# is CF and onClick needs js.

but #linkStyle# is just the name of a CF variable, a container, if you
will (this one just cones from the db).

that container can contain anything you want it to, for example:

<cfset #linkStyle# =
'
<html>
<head>
<cfscript language="_javascript_"

myFunction( ) {

alert("Hi");
}
'
/>


so in your example, the columns in the current row of the query contain:

columnName    Content
----------    -------
linkName      Apple

linkURL       www.apple.com

linkStyle     MinorRts

if column named linkStyle in the current row of the database contains
MinorRts

then outputting:

<br><a href=""
#linkName# </a>

will yield:

<br><a href=""
Apple </a>

As I understand it, that is exactly what you want.

The next row will have different values so the next link will reflect
this

HTH

Dick

>  I don't know how to loop through this onClick variable to get the
> range of values to be produced - one for each iteration of the
> results, like:
>  menu item one: ...> >  menu item two: ...> >  menu item two: ...> >  etc.
>
>  Does that help?
>
>  >I realize that you are trying to create a list of links -- what I
> can't
>  >understand is where the dynamic data is supposed to come from
>  >
>  >I would write something like:
>  >
>  ><cfquery name=menu>
>  >���SELECT��linkName, linkURL, linkStyle FROM linkTable
>  ></cfquery>
>  >
>  >yields a query containing:
>  >
>  >linkName��� linkURL������������ linkStyle
>  >----------��------------------��--------------
>  >Apple������ www.apple.com������ colorful
>  >Macromedia��www.macromedia.com��flashy
>  >Microsoft���www.microsoft.com���opportunistic
>  >
>  >Now, iterating over the query:
>  >
>  ><cfoutput query=menu>
>  ><br><a href="" style=#linkStyle#> #linkName# </a>
>  ></cfoutput>
>  >
>  >
>  >yields:
>  >
>  ><br><a href="" style=colorful> Apple </a>
>  ><br><a href="" style=flashy > Macromedia </a>
>  ><br><a href="" style=opportunistic > Microsoft </a>
>  >
>  >I know this is not exactly what you want, but using the same
> technique,
>  >can you show me what you want?
>  >
>  >Dick
>  >
>  >
>  >On Apr 13, 2004, at 11:55 AM, Joy Holman wrote:
>  >
>  >>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to