Forum Moderators: not2easy

Message Too Old, No Replies

Spreaded thumbnails on archive page

Strange behaviour on archive pages

         

birba

1:10 pm on Jul 28, 2010 (gmt 0)

10+ Year Member



Hi to everybody.
I have a photblog whose archive is organized in several pages; it can be browsed either by categories or months. Since I’m experiencing a strange situation so I would try to ask some help to solve the problem.
Looking at some archive page is possibile to see that the thumbnails are spreaded over the page and not ordered in rows of six. I mean, for instance, the first row has six thumbnails, the secon just one, the thisrd three, the fourth again six and so on. It would be helpful to give a look at the page, but, as far as I have understood it is not allowed to post any link to this forum. Note that such behaviour occur mainly on the older pages.
So know anybody what is the cause of such behaviour?
Note that I’m using the Movable Type Platform with paginate plug-in; by-the-way the same problem occurred even befor using the plug-in.
I’m using the following HTML code on all archive pages:
<table align=center width="800px">
<tr>
<td width=800px height=auto align=center valign=middle>
<MTPaginate>
<!–The next part is what generates the "page navigation" –>
<MTPaginateIfMultiplePages>
<p><$MTPaginateNavigator style="links" format="%d" $></p>
</MTPaginateIfMultiplePages>
<!– This part determines how many posts will go on the page, I set it to 30 –>
<MTPaginateContent max_sections="30">
<div id="wrapper">
<MTEntries lastn="2000">
<div class="thumb"><a href="<$MTEntryPermalink$>"><MTEntryExcerpt></a></div>
<$MTPaginateSectionBreak$>
</MTEntries>
<div class="clear"></div>
</div><!-close wrapper->
</MTPaginateContent>
</MTPaginate>
<div style="clear:both"></div>
</td>
</tr>
</table>

and the following CSS codes:
#wrapper{
margin: 10px auto;
text-align:left;
width:800px;
background-color:#FFF;
padding:20px 20px 20px 20px;
}

div.thumb{
margin: 5px;
border: 1px solid #BBB;
height: auto;
float:left;
text-align:center;
background-color:#FFF;
color:#FFF;
}

.thumb img{
display:inline;
margin: 5px;
background-color:#FFF;
color:#FFF;
}

Thank you much in advance for any help.

morehawes

2:00 pm on Jul 28, 2010 (gmt 0)

10+ Year Member



Hi, with the code provided it will be hard to help with this. Perhaps you could post the full HTML after the plugin has loaded?

birba

2:28 pm on Jul 28, 2010 (gmt 0)

10+ Year Member



Morehawes
I'm sorry but I didn't get what you mean. Neverheles if you mean I should post the full HTML code it can be see below
<body>
<div id="container">
<div id="banner">
<h1><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></h1><br/>
<h2><$MTBlogDescription$></h2>
</div>
<$MTInclude module="NavigationArchive"$>
<$MTInclude module="Pulldown"$>
<div id="center">
<div class="content">
<table align=center width="800px">
<tr>
<td width=800px height=auto align=center valign=middle>
<MTPaginate>
<!–The next part is what generates the "page navigation" –>
<MTPaginateIfMultiplePages>
<p><$MTPaginateNavigator style="links" format="%d" $></p>
</MTPaginateIfMultiplePages>
<!– This part determines how many posts will go on the page, I set it to 30 –>
<MTPaginateContent max_sections="30">
<div id="wrapper">
<MTEntries lastn="2000">
<div class="thumb"><a href="<$MTEntryPermalink$>"><MTEntryExcerpt></a></div>
<$MTPaginateSectionBreak$>
</MTEntries>
<div class="clear"></div>
</div><!-close wrapper->
</MTPaginateContent>
</MTPaginate>
<div style="clear:both"></div>
</td>
</tr>
</table>
</div>
</div>
</div>
<$MTInclude module="Footer"$>
</body>

But I feel it doesn't give more useful information.
Again, I point out that this problem occurred before to use the paginate plug-in as well as presently with the same plug-in installed.
Thanks a lot

rocknbil

7:23 pm on Jul 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is the movableType template code, and by the looks of it the wrong chunk of code.

1. In your browser, go to the page with the layout messed up.

2. Select view source to view the source HTML code.

3. Do not copy the entire source code, copy just the section that's causing the problem. Copy only a section representing one or two rows of the page, and paste it here.

4. Look at this source code for class and id selectors, copy only the CSS selectors affecting this page. Paste those too so we can see the CSS.

With a smaller section of code that demonstrates the problem, someone will be able to help.

birba

9:30 pm on Jul 28, 2010 (gmt 0)

10+ Year Member



Rocknbil
first of all a news. I have tried to give a look to one of the affected pages using safari with Mac, and with my great surprise I have seen that it seems to work fine, while using both firefox and IE8 I have noticed still the same problem. So this would mean that the codes are read wrongly by the two latter browsers. Is this correct? In any case I would still like to solve the problem as the majority of people uses firefox and IE.
Said that, following your suggestion here below I'm posting the code of some rows affected by the problem from the related source page :
<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/07/sunset_on_the_n.php"><img alt="sunset_on_the_net.jpg" src="http://www.alookthroughlens.com/weblog/archives/sunset_on_the_net-thumb.jpg" width="100" height="75" title="Sunset on the net / Tramonto sulla rete &bull;&bull; 06 July, 2005"/>
</a></div>

<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/07/tree_of_peoplea.php"><img alt="tree_of_people.jpg" src="http://www.alookthroughlens.com/weblog/archives/tree_of_people-thumb.jpg" width="100" height="75" title="Tree of people / Albero d'uomini &bull;&bull; 05 July, 2005"/></a></div>

<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/07/acrobaticsequil.php"><img alt="acrobatics.jpg"
src="http://www.alookthroughlens.com/weblog/archives/acrobatics-thumb.jpg" width="100" height="75" title="Acrobatics / Equilibrismi &bull;&bull; 04 July, 2005"/></a></div>

<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/07/contrastcontras.php"><img alt="contrast.jpg" src="http://www.alookthroughlens.com/weblog/archives/contrast-thumb.jpg" width="100" height="75" title="Contrast / Contrasto &bull;&bull; 04 July, 2005"/></a></div>

<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/07/reflectionsrifl.php"><img alt="Reflections.jpg" src="http://www.alookthroughlens.com/weblog/archives/Reflections-thumb.jpg" width="100" height="75" title="Reflections / Riflessi &bull;&bull; 03 July, 2005"/></a></div>

<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/07/real_life_signs.php"><img alt="real_life_signs.jpg" src="http://www.alookthroughlens.com/weblog/archives/real_life_signs-thumb.jpg" width="100" height="75" title="Real life signs / Segni di vita vissuta &bull;&bull; 02 July, 2005"/></a></div>

<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/07/birba.php"><img alt="birba.jpg" src="http://www.alookthroughlens.com/weblog/archives/birba-thumb.jpg" width="100" height="75" title="Birba &bull;&bull; 01 July, 2005"/></a></div>

<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/06/thirtyfive_past.php"><img alt="thirtyfive_past_sixteen.jpg" src="http://www.alookthroughlens.com/weblog/archives/thirtyfive_past_sixteen-thumb.jpg" width="100" height="75" title="Thirtyfive past sixteen/Sedici e trentracinque &bull;&bull; 30 June, 2005"/></a></div>

<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/06/croatian_compos.php"><img alt="croatian_composition.jpg" src="http://www.alookthroughlens.com/weblog/archives/croatian_composition-thumb.jpg" width="100" height="75" title="Croatian composition/Composizione croata &bull;&bull; 29 June, 2005"/></a></div>

<div class="thumb"><a href="http://www.alookthroughlens.com/weblog/archives/2005/06/croatian_landsc.php"><img alt="hvar_001.jpg" src="http://www.alookthroughlens.com/weblog/archives/hvar_001-thumb.jpg" width="100" height="75" title="Croatian Landscape/Paesaggio Croato &bull;&bull; 28 June, 2005"/></a></div>

and the following should be the related css codes:
div.thumb{
margin: 5px;
border: 1px solid #BBB;
height: auto;
float:left;
text-align:center;
background-color:#FFF;
color:#FFF;
}

.thumb img{
display:inline;
margin: 5px;
background-color:#FFF;
color:#FFF;
}


Thank you so much.

rocknbil

1:23 am on Jul 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nothing stands out immediately . . . the only thing I see is there's no widths on your floats, generally you need to set the width when you float. It's entirely possible that for whatever reason they are going full width (though can't say why . . . ) Since all your thumbs are a set 100 px wide, you can try

div.thumb{
margin: 5px;
border: 1px solid #BBB;
height: auto;
float:left;
width:110px;
text-align:center;
background-color:#FFF;
color:#FFF;
}

I set it to 110px because there's a 5px margin on .thumb img . . . see if that helps, not saying it will, but worth a shot.


Though this will have nothing to do with it, fix this in your template:

<table align=center width="800px">
<tr>
<td width=800px height=auto align=center valign=middle>

px is not valid for the attribute, but it IS valid for CSS (style="width:800px") Use

<table align="center" width="800">
<td width="800" height="auto" align="center" valign="middle">

or more simply, since there's only one cell, width is set by the table, and auto is default

<table align="center" width="800">
<td align="center" valign="middle">

birba

6:58 am on Jul 29, 2010 (gmt 0)

10+ Year Member



Rocknbil
thank you much; I'll do what you suggested and I'll be back with the result as soon I have tested it.
Thank you again.

birba

1:47 pm on Jul 29, 2010 (gmt 0)

10+ Year Member



Hi rocknbil
I’m back to let you know about the result following your suggestions.
The page still has the same problem! But I would like to make you aware about one thing even if is not so easy to explain it without giving a look at the web page. Looking with more attention at one of the messed up web page layout (page 47) I noticed something strange. First of all you should take note that, generally, the archive page is shown as a grid of five rows with six thumbnails each. Now, the first two rows are complete, means with six thumbs each. The fourth thumb of the second row sticks out below a bit taking as reference the bottom of the related row. On the third row I have just two thumbs the first of which take place exactly below the thumb after the jutting one. These two thumbs are not jutting and the subsequent row is complete and it looks exactly as the second row, therefore with a jutting thumb at the fourth place and the subsequent row, the fifth one, still looks exactly as the third. In other words it seems that the layout looks fine in absence of jutting thumbs, while in presence of them the first thumb of a certain row takes place below the thumb of the row above exactly after the jutting one.
Take note that I have tested the modified code just on IE as I’m at office and the neither the firefox nor the safari are available.
Finally take note that 115px width is the value working better even if it seems to be not the cause of the problem.
Thanks and Regards

rocknbil

7:00 pm on Jul 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The fourth thumb of the second row sticks out below a bit taking as reference the bottom of the related row.


HAH! You got it. With the images floated left, they will float until the parent container is filled, then go immediately to the next row and attempt to float left again, but that hanging image is causing it to stop at the image's lower right edge.

Normally, you could fix this with a clearing element. You have one in your template (<div class="clear"></div> ) but that's not the problem. View the source code and compare these two:

<div class="thumb"><a href="/bubbles_of_wate.php"><img alt="bubbles_of_water.jpg" src="/bubbles_of_water-thumb.jpg" width="100" height="75" title="Bubbles of water / Bolle d'acqua &bull;&bull; 18 July, 2005"/></a></div>

<div class="thumb"><a href="/vigevano_the_ca.php"><img alt="vigevano_the_cathedral.jpg" src="/vigevano_the_cathedral-thumb.jpg" width="100" height="75" title="Vigevano the Cathedral / Vigevano il Duomo &bull;&bull; 17 July, 2005"/> <!-- NOTE THE BIG SPACE HERE --> </a></div>

It is the SPACE that is hanging, when it renders it's interpreting it as a line and adding padding to it. What could cause that? Look at the original template:

<div class="thumb"><a href="<$MTEntryPermalink$>"><MTEntryExcerpt></a></div>

Go into your database admin for these two items (MT,) look at the entries, I am guessing you will find a space in the field for "excerpt" or "description" or something. Delete that space, it should go away.

Alternatively you could remove the bolded part from the template if you never plan to use it, but do that only as a last resort, it will remove the possibility of it's functionality.

You can remove the width selector from the CSS, though it doesn't hurt, that was not the issue.

birba

8:23 pm on Jul 29, 2010 (gmt 0)

10+ Year Member



Yeah! You was right! The space was really there, in the excerpt field.
Now it's working fine.
Thanks a lot for help.
Regards.