• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using collapsible divs with cfoutput

Contributor ,
Jan 15, 2009 Jan 15, 2009

Copy link to clipboard

Copied

Hi there -
I haven't quite got started yet - I'm trying to avoid a bunch of time-consuming experimentation and was hoping
someone here had already done something like this and could point me in the right direction -

I'm attaching some code created by Dynamic Drive that creates collapsible divs from hard-coded info (as in a
dynamic menu tree). What I'd like to do is figure out a way to replace that hard-coded info with data dynamically
generated with a query, looping through as one does with a table. I'm avoiding using the table because the number
of variables is so many, outputting them to table rows is overwhelming for the viewer. I'm thinking collapsible divs
will do the trick nicely.

How would I go about using the attached code to loop through the query and dynamically create divs? It doesn't
seem like it's a simple matter of creating a cfoutput using this code with the necessary variables, like when you
use a query to generate rows in a table... From what I've seen, it looks like maybe I'd have to convert to query to
xml (as per another collapsible div example I've seen). This looks hairy to me! so I'm wondering if that's strictly
necessary. If this is the only way, I guess I just need someone to tell me so and that's what I'll do. Any ideas?


Here's what I'm trying to create:

Output name of first teacher - a date - a second kind of date
**beginningoffirstcollapsiblediv**
Information about a workshop - more info - more info
Information about a workshop - more info - more info
**endoffirstcollapsiblediv**

Output name of second teacher - a date - a second kind of date
**beginningofsecondcollapsiblediv**
Information about a workshop - more info - more info
Information about a workshop - more info - more info
Information about a workshop - more info - more info
Information about a workshop - more info - more info
**endofsecondcollapsiblediv**

Output name of third teacher - a date - a second kind of date
**beginningofthirdcollapsiblediv**
Information about a workshop - more info - more info
Information about a workshop - more info - more info
Information about a workshop - more info - more info
**endofthirdcollapsiblediv**

and so on... for as many staff as fit the query's parameters.
TOPICS
Advanced techniques

Views

317

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Jan 15, 2009 Jan 15, 2009
Okay - I'm feeling pretty dumb - I just discovered that there is a Spry widget that does this sort of thing - boy, do things move quickly!

Votes

Translate

Translate
Contributor ,
Jan 15, 2009 Jan 15, 2009

Copy link to clipboard

Copied

LATEST
Okay - I'm feeling pretty dumb - I just discovered that there is a Spry widget that does this sort of thing - boy, do things move quickly!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation