Solved

List Layers and Coldfusion

Posted on 2010-08-16
13
362 Views
Last Modified: 2013-12-24
I really do not know if this can be done.

I have a page with a layer that layer has to have a fixed height. I have a list that displays in the layer. The list has two lines of text in each entry. Sometimes the entry wraps to another line. Right now I use a loop to look through the top 17 entries in the list and adjust the list accordingly.

Here is the issue. Some lines warp at 50 characters and some at 53 or so. So if I set the limit to 50 some pages the layer does not fill up and some go slightly past.

See the  page here. Look under the PAC-10 at different schools and you will see what I mean.
http://www.pigskinu.com/oregon.html

See my code below.
The result of this code it for every two articles that warp it deletes one article from the list.
<cfif len(title) gt 50>

        	<cfif overagen is 1>

	       <cfset newscount = newscount - 1>

                <cfset overagen = overagen + 1>            

	<cfelseif overagen lt 2>

	       <cfset overagen = overagen + 1>

         <cfelse>

                <cfset overagen = 0>

         </cfif>

        </cfif>

    </cfloop>

Open in new window

0
Comment
Question by:RickEpnet
  • 7
  • 3
  • 2
13 Comments
 
LVL 16

Accepted Solution

by:
s8web earned 334 total points
ID: 33449136
What different schools?
0
 
LVL 14

Author Comment

by:RickEpnet
ID: 33449238
Did you click on PAC-10 in the main menu?
0
 
LVL 16

Assisted Solution

by:s8web
s8web earned 334 total points
ID: 33449764
Are you talking about the area on the left under the heading "Team News Around the Web"?
0
 
LVL 16

Expert Comment

by:s8web
ID: 33449796
Check this out. It may simplify things - http://www.cflib.org/udf/abbreviate 
0
 
LVL 14

Author Comment

by:RickEpnet
ID: 33450790
Maybe I am missing something. Either that or you do not understand what I am looking for. At any rate I appreciate you taking the time to post.

Just so I am clear I want it to wrap and there is no HTML in the Title Field. The problem is different Titles wrap at different points. For example if I had a line that was all IIIIIIIIIIIIIIIIIIIIIIII it would wrap at a different point than if I had a line of all WWWWWWWWWWW. Not this is an extreme example but I think this will help demonstrate what I am talking about.  

IIIIIIIIIIIIIIIIIIII
WWWWWWWWWWWWWWWWWWWW

Basically what I need it a way to figure out how many articles to list without overflow.
0
 
LVL 14

Author Comment

by:RickEpnet
ID: 33551564
Can we close this
0
Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

 
LVL 14

Assisted Solution

by:Scott Bennett
Scott Bennett earned 166 total points
ID: 33754989
The only way I could think of to handle this on the CF would be to actually take the time to measure the pixel with of each possible character and assign it a value in a structure then use that to figure out how wide each line would be to determine if it would wrap.

On the client side, if you use AJAX or a javascript array to populate that news box you could have the javascript determine when the box is full by measuring the distance between the bottom of each list item and the bottom of the containing div layer using x/y coordinates and stop when its full.

0
 
LVL 14

Author Comment

by:RickEpnet
ID: 33762132
How would you do this with JavaScript

On the client side, if you use AJAX or a javascript array to populate that news box you could have the javascript determine when the box is full by measuring the distance between the bottom of each list item and the bottom of the containing div layer using x/y coordinates and stop when its full.
0
 
LVL 14

Author Comment

by:RickEpnet
ID: 33814886
Ask again

How would you do this with JavaScript

On the client side, if you use AJAX or a javascript array to populate that news box you could have the javascript determine when the box is full by measuring the distance between the bottom of each list item and the bottom of the containing div layer using x/y coordinates and stop when its full.
0
 
LVL 14

Expert Comment

by:Scott Bennett
ID: 33815080
What version of CF are you running? if you have 8 or 9 i will give you a different example then if you have 7 or lower.
0
 
LVL 14

Author Comment

by:RickEpnet
ID: 33815217
8
0
 
LVL 14

Author Closing Comment

by:RickEpnet
ID: 33952080
No one answered the question I just want it off my list
0

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error on Add method 1 37
Put radio button in my form but already has components from my database 4 44
HTML Relative path 9 29
Wrapper for APPs 9 31
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

911 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

16 Experts available now in Live!

Get 1:1 Help Now