ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Problem using count within a table

February 15, 2010 4:43pm

Subscribe [3]
  • #1 / Feb 15, 2010 4:43pm

    onepanman

    44 posts

    Nearly a year ago, I developed the following page for artist profiles.

    http://www.visualsound.net/index.php/artists

    At the time, there were roughly 25 artist in the system. Today there are over 105 artists.

    The problem is, the code is stopping at 100.

    I am using the following code to generate the table.

    {exp:weblog:entries orderby="url_title" sort="asc" weblog="artist" disable="categories|member_data|trackbacks" } 
    
    <div class="clear"> </div>
    
    
    <td align="left" valign="top">
    <a href="http://{path="><?php $clean_image_tag = </a>
    
    
    <h4><a href="http://{path="><strong>{title}</strong></a></h4>
    <p><div class="clear"> </div></p>
    
    <p>{if count == "5"}</tr><tr>{/if}<br />
    {if count == "10"}</tr><tr>{/if}<br />
    {if count == "15"}</tr><tr>{/if}<br />
    [... all the way to 150]<br />
    {/exp:weblog:entries}<br />
    </td></tr></table>

    Obviously, the count option is not optimal, but when it was originally created it was set to 50 and has since grown.  I am using a weblog (artists) that contains fields for a variety of details, so a gallery was not an option. 

    First problem obviously, is why has it stopped at 100? There is no limit parameter set in the weblog query and the count as non-optimal as it is goes to 150.

    Second, what is an optimal way to display this page?

    Thanks!

    note: the content is handled through the client which did not use the the same image size for each of the artists, so if anyone was wondering why the photos are scaled, it was due to lack of following directions on image sizes 😊 I think they download the image from the artists…

  • #2 / Feb 15, 2010 5:04pm

    Ingmar

    29245 posts

    The problem is, the code is stopping at 100.

    There is a built-in limit of 100. Use the limit= parameter to specify a higher value.

  • #3 / Feb 15, 2010 5:26pm

    onepanman

    44 posts

    Well that was easy… did not realize there was a limit redefined. I guess, I will need to set the limit to something fairly high to prevent that issue from reoccurring (say 500).

    Now, does anyone want to help tackle the optimization issue? 😊

  • #4 / Feb 15, 2010 5:45pm

    Ingmar

    29245 posts

    You should probably use some PHP 😊

  • #5 / Feb 16, 2010 10:01pm

    onepanman

    44 posts

    I ended up changing the code from tables to divs and used the switch parameter. A whole lot better.  Next question and this might need to be moved to a new topic.

    I really would like to clean up the actual images on this page.  Here is the problem. I have it set to a 125x125 pixel using a paramater on the image tag. The problem is, the client uploads the image and the image varies from being square, portrait or landscape. They do not resize images or crop images, although I have TinyMCE ImageManager available to them.

    Is there a way to resolve this problem other than telling them to stay with one type of image (cause, that is not likely to do any good.)?

    I thought about having a second field that they would upload a set image, say I decide to it should be landscape, and that will be used, but that will just add another field they will have to populate and would only just select the same image.

    Advice?

  • #6 / Feb 17, 2010 1:30am

    John Henry Donovan

    12339 posts

    onepanman,

    You could use the ImageSizer plugin which would allow you to keep your dimensions but zoom crop it for you.

    From ImageSizer Instructions

    if “width” is = to “height” the image will be cropped from image center to make a square sized image.

    If you are happy with that I can close this thread out? If you require further assistance on image resizing techniques then you are welcome create a new thread in the ‘How to’ forum.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases