Overflow (images pushed down) issue in IE and css-fix

doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Wed, 2005-01-26 15:55

Hi community,

this is my first post here and i just want to give something back to you. :)
I use Gallery since 1.44 i think and switched to 2.0 alpha. The interface is nice but there is the problem with the <div></div> overflow in IE.

I fixed the issue using some css-formating and will show you here. It is done by defining the positions + width for the "main-picture-block" and adjusting the sidebar the same way.

The fix is still "hard-coded" but its possible to put in the theme-related css-file.

Files to create:

./gallery2homedirectory/layouts/matrix/templates/singleBody.tpl.local

{*
 * $Revision: 1.39 $ $Date: 2004/11/22 22:45:58 $
 * If you want to customize this file, do not edit it directly.
 * Instead, copy it to singleBody.tpl.local and edit that version instead.
 * Gallery will look for that file first and use it if it exists
 * and when you upgrade, your changes will not get overwritten.
 *}
{if !empty($layout.imageViews)}
{assign var="image" value=$layout.imageViews[$layout.imageViewsIndex]}
{/if}
      
{include file="gallery:layouts/matrix/templates/pathbar.tpl"}  

<div id="gsContents" style="position:absolute; top:91px; left:10px; width:180px; z-index:1;">
  {include file="gallery:templates/sidebar.tpl"} 
</div>

<div id="gsAlbumContents" style="position:absolute; top:91px; left:190px; z-index:2; width:auto; height:auto;">
    <div class="gbTopFlag">
      <table class="gbTitleBanner">
        <tr>
          <td>
            <h1 class="giTitle">
              {$layout.item.title|default:$layout.item.pathComponent|markup}
            </h1>
            <p class="giDescription">
              {$layout.item.description|markup}
            </p>
          </td>
          <td>
            <ul class="giInfo">
              <li>
                {if !empty($layout.useCaptureDate) && isset($layout.captureTimestamp)}
                {capture name=itemTimestamp}{g->date timestamp=$layout.captureTimestamp}{/capture}
                {else}
                {capture name=itemTimestamp}{g->date timestamp=$layout.item.creationTimestamp}{/capture}
                {/if}
                {g->text text="Date: %s" arg1=$smarty.capture.itemTimestamp}
              </li>
        
              {if count($layout.imageViews) > 1}
              <li>
                {g->text text="Size: "}
                <select onchange="{literal}javascript:if (this.value) { newLocation = this.value; this.options[0].selected = true; location.href= newLocation; }{/literal}">
                  {section name=imageView loop=$layout.imageViews}
                  {if $smarty.section.imageView.index == $layout.imageViewsIndex}
                  {assign var="selected" value="selected=\"selected\""}
                  {else}
                  {assign var="selected" value=""}
                  {/if}
        
                  <option {$selected} value="{g->url arg1="view=core:ShowItem" arg2="itemId=`$layout.item.id`" arg3="imageViewsIndex=`$smarty.section.imageView.index`"}">
                    {if empty($layout.imageViews[imageView].width)}
                      {if isset($layout.imageViews[imageView].isSource)}
                      {g->text text="Source"}
                      {else}
                      {g->text text="Unknown"}
                      {/if}
                    {else}
                    {g->text text="%dx%d" arg1=$layout.imageViews[imageView].width arg2=$layout.imageViews[imageView].height}
                    {/if}
                  </option>
                  {/section}
                </select>
              </li>
              {/if}
        
              {if !empty($layout.sourceImage)}
              <li>
                {g->text text="Full size: "}
                {capture name="fullSize"}
                {if empty($layout.sourceImage.width)}
                {$layout.sourceImage.itemTypeName.0}
                {else}
                {g->text text="%dx%d" arg1=$layout.sourceImage.width arg2=$layout.sourceImage.height}
                {/if}
                {/capture}
                {if count($layout.imageViews) > 1}
                <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$layout.item.id`" arg3="imageViewsIndex=`$layout.sourceImageViewIndex`"}">{$smarty.capture.fullSize}</a>
                {else}
                {$smarty.capture.fullSize}
                {/if}
              </li>
              {/if}

              {if $layout.showImageOwner}
              <li>
                {g->text text="Owner: %s" arg1=$layout.owner.fullName|default:$layout.owner.userName}
              </li>
              {/if}
            </ul>
          </td>
        </tr>
      </table>
    </div>

<div class="gbNavBar">
      {include file="gallery:layouts/matrix/templates/itemNavigator.tpl"}
    </div>

    <div class="gsSingleImage">
      {if !empty($layout.imageViews)}
      {capture name="fallback"}
      <a href="{g->url arg1="view=core:DownloadItem" arg2="itemId=`$layout.item.id`"}">
        {g->text text="Download this %s" arg1=`$layout.sourceImage.itemTypeName.1`} 
      </a>
      {/capture}

      {if ($layout.can.viewInline[$layout.imageViewsIndex])}
	{if isset($layout.frame)}
	  {include file=$layout.frame.template ImageFrame_data=$layout.frame.data
		   ImageFrame_frame=$layout.frame.photoFrame item=$layout.item image=$image}
	{else}
	  {g->image item=$layout.item image=$image fallback=$smarty.capture.fallback}
	{/if}
      {else}
	{$smarty.capture.fallback}
      {/if}
      {else}
	{g->text text="There is nothing to view for this item."}
      {/if}
    </div>

    {if !empty($layout.itemDetailFiles)}
    {foreach from=$layout.itemDetailFiles key=moduleId item=detailFile}
    {include file="gallery:$detailFile" l10Domain="modules_$moduleId"}
    {/foreach}
    {/if}

    <div class="gbBottomFlag">
      <div class="gbNavBar">
        {include file="gallery:layouts/matrix/templates/itemNavigator.tpl"}
      </div>
    </div>
</div>

./gallery2homedirectory/templates/sidebar.tpl.local

{*
 * $Revision: 1.6 $ $Date: 2004/11/23 06:18:55 $
 * If you want to customize this file, do not edit it directly.
 * Instead, copy it to sidebar.tpl.local and edit that version instead.
 * Gallery will look for that file first and use it if it exists
 * and when you upgrade, your changes will not get overwritten.
 *}
{if $layout.show.sidebar}
<div id="gsSidebar" style="width:180px">

  {* System links in sidebar? *}
  {if (!empty($layout.show.systemLinks) && !empty($layout.systemLinks))}
  <div class="gbMenu">
    {if $layout.show.sidebarGreeting}
    <h3 class="giTitle">
      {g->text text="Welcome, %s" arg1=$layout.user.fullName|default:$layout.user.userName}
    </h3>
    {/if}
    <ul>
      {foreach from=$layout.systemLinks item=link}
	<li> <a href="{$link.url}">{$link.text}</a> </li>
      {/foreach}
    </ul>
  </div>
  {/if}

  {* Navigation to parents in sidebar? *}
  {if (!empty($layout.show.parents) && !empty($layout.parents))}
  <div class="gbMenu">
    <h3 class="giTitle">{g->text text="Navigation"}</h3>
    <ul>
    {foreach from=$layout.parents item=parent}
      <li>
        &
        <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$parent.id`"}">
          {$parent.title|default:$parent.pathComponent|markup}
        </a>
      </li>
    {/foreach}
    </ul>
  </div>
  {/if}

  {* Core System content *}
  {if isset($layout.systemContent.core.login)}
  {assign var=moduleFile value=$layout.systemContent.core.login}
  {include file="gallery:$moduleFile" l10Domain="modules_core"} 
  {/if}

  {* Search form, if module is activated *}
  {if isset($layout.systemContent.search.searchBox)}
  {assign var=moduleFile value=$layout.systemContent.search.searchBox}
  {include file="gallery:$moduleFile" l10Domain="modules_search"} 
  {/if}

  {if isset($smarty.capture.sidebarInsert_1)} {$smarty.capture.sidebarInsert_1} {/if}

  {* Item actions *}
  {if ($layout.show.sidebarActions && !empty($layout.itemLinks))}
  <div class="gbMenu">
    <h3 class="giTitle">{g->text text="Actions"}</h3>
    <ul>
      {foreach from=$layout.itemLinks item=link}
      <li><a href="{$link.url}">{$link.text}</a></li>
      {/foreach}
    </ul>
  </div>
  {/if}

  {* Peer items *}
  {if $layout.show.sidebarPeers}
  <div class="gbMenu">
    <h3 class="giTitle"> {$layout.parent.title|default:$layout.parent.pathComponent|markup}</h3>
    <p class="giDescription">
      {g->text one="(%d item)" many="(%d items)" count=$layout.peerCount arg1=$layout.peerCount}
    </p>

    <ul>
      {assign var="lastIndex" value=0}
      {foreach from=$layout.peers item=peer}
      {assign var="title" value=$peer.title|default:$peer.pathComponent|markup}
      {if ($peer.peerIndex - $lastIndex > 1)}
      <li>...</li>
      {/if}

      {if ($peer.id == $layout.item.id)}
      <li class="giSelected">
        {g->text text="%d. %s" arg1=$peer.peerIndex arg2=$title|entitytruncate:14}
      </li>
      {else}
      <li><a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$peer.id`"}">
        {g->text text="%d. %s" arg1=$peer.peerIndex arg2=$title|entitytruncate:14}</a></li>
      {/if}
      {assign var="lastIndex" value=$peer.peerIndex}
      {/foreach}
    </ul>
  </div>
  {/if}

  {if isset($smarty.capture.sidebarInsert_2)} {$smarty.capture.sidebarInsert_2} {/if}

  {* Extra modules system content *}
  {foreach from=$layout.systemContent key=moduleId item=moduleContent}
  {foreach from=$moduleContent key=moduleContentKey item=moduleFile}
  {if ($moduleId != 'search' || $moduleContentKey != 'searchBox') && ($moduleId != 'core' || $moduleContentKey != 'login')}
    {include file="gallery:$moduleFile" l10Domain="modules_$moduleId"}
  {/if}
  {/foreach}
  {/foreach}

  {if isset($smarty.capture.sidebarInsert_3)} {$smarty.capture.sidebarInsert_3} {/if}

</div>
{/if}

So what had i done here? I specified the width of the sidebar manually and format it "hard" in the "Main display tpl". I also reformated some <div></div> things. Just have a look and excuse my bad english.

"The main thing":

...
<div id="gsContents" style="position:absolute; top:91px; left:10px; width:180px; height:150px; z-index:1;">
  {include file="gallery:templates/sidebar.tpl"} 
</div>

<div id="gsAlbumContents" style="position:absolute; top:91px; left:190px; z-index:2; width:auto; height:auto;">
    <div class="gbTopFlag">
...
AttachmentSize
local.tpl.files.zip2.98 KB
 
thumb
thumb's picture

Joined: 2004-05-26
Posts: 238
Posted: Wed, 2005-01-26 16:13

doctormord, Thanks for contributing!

A few questions:
1. Have you tested these modifications in browsers other than IE (Mozilla/Firefox, Safari, Opera)? IE is our primary concern, but we want to consider issues these modifications might create in other browsers too.

2. Are the height declarations required? What happens if you leave them out?

 
doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Wed, 2005-01-26 16:42
thumb70 wrote:
doctormord, Thanks for contributing!

A few questions:
1. Have you tested these modifications in browsers other than IE (Mozilla/Firefox, Safari, Opera)? IE is our primary concern, but we want to consider issues these modifications might create in other browsers too.

I did not tested it with other browsers than IE, but maybe someone could do it? It should work, cause its "minimal" CSS and i checked the restrictions via "selfhtml". They sad that positioning should always work on DIV-tags. There might be some problems with other tags i.e. TABLE etc. So it should work. ( imo IE has the baddest css-support of all actuall browsers)

Quote:
2. Are the height declarations required? What happens if you leave them out?

The "height:150px" is not required. I'll remove it in the first post.

Thanks for feedback.

doc

EDIT:

You may check, how it looks like here:

http://www.n0t.de

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-01-26 16:57

i made my mozilla browser window narrow and the album block moved below the sidebar.. i guess this change moves the problem from IE to mozilla and other browsers. :(

 
doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Wed, 2005-01-26 17:28

I tested it with Firefox 1.0 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0)

And it works very well.

 
thumb
thumb's picture

Joined: 2004-05-26
Posts: 238
Posted: Wed, 2005-01-26 21:09
Quote:
i made my mozilla browser window narrow and the album block moved below the sidebar.. i guess this change moves the problem from IE to mozilla and other browsers. icon_frown.gif

The same was true for me. I tested http://www.n0t.de in the the following browsers and the albumContents area wrapped in all of them, IE included. Win/Firefox 1, Win/IE 6, Win/Opera 7.5, Mac/Firefox 1, Mac/Opera 7.5, Mac/Safari 1.2, Mac/IE 5

doctormord, perhaps there's a browser cache issue when you're testing?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-01-26 21:18

doctormord, you don't understand the problem or perhaps you wanted to solve a different problem.
I browsed to your G2 website and the the thumbnail images move all below the sidebar if the browser windows is small enough (about < 800px). I tested it in IE 6 SP2, opera 7.x, firefox 1.
Plus, IE 6 and firefox 1 show a different result than opera when looking at images with a huge width, see http://www.n0t.de/main.php/view/user_bilder/hbtje/lfa2k4/IMG_0573.jpg?g2_imageViewsIndex=4

@thumb70: this overflow with the extreme wide images causes also the problem in the embedded G2s. When embedded, G2 should have scroll bars instead of just overflow.

 
thumb
thumb's picture

Joined: 2004-05-26
Posts: 238
Posted: Wed, 2005-01-26 21:26

valiant: I believe that the only scroll bars that should appear in the Matrix layout are the browser scroll bars. By design in Matrix if an image or album table is wider than the browser window, browser window scrolling should kick in.

My problem with the Matrix layout right now is that the header and footer widths should match the width of images and/or album tables, and, of course, album tables and images should not wrap below the sideBar :wink:

I'll figure this out, eventually.

I don't plan on adding "overflow: auto" to any Matrix container. If this is a special requirement for embedding when using certain G2 layouts, let's deal with it through an embed specific layout transformation.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-01-26 21:33

somehow the header width is correct in opera 7.x for the wide image from the above link, but not in IE / firefox.
...good luck. i tweaked the css for the tabbed menu of my website (www.nei.ch) for weeks (or months?) to get it finally working. yes, finding css that works in all browsers to get a semantically correct websites (tableless) is a real pain.

 
doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Wed, 2005-01-26 21:54

hmm, it works for me in different browsers on different machines... ?! strange...

 
doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Thu, 2005-01-27 19:00

I asked several people to test this hack and all told me, that the picture is beside the sidebar not under it so i think it works. :D

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-01-27 20:31

did any of them (or you) resize the browser and make it narrow?

 
doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Fri, 2005-01-28 19:43

Yes, they did. I even asked some more ppl and all of them told me, that it works:

Browsers tested:

Opera 7.54
Firefox 1.0
IE 6.0
konqueror 3.3.1

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-01-28 19:55

well, glad it's working for you and your users, but it doesn't seem to work for others.

I just went to your link above again, and narrow browser wrapped the album content below the sidebar.

Win2k
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616

 
doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Fri, 2005-01-28 20:02

Hmm, i only asked german Users to test this, maybe it depends on the language Setting in Browser? :~

But maybe "position:absolute/relative + width, height and px settings" CSS is a way in the right direction. :|

 
loyukfai

Joined: 2004-11-29
Posts: 58
Posted: Fri, 2005-01-28 20:51

Just want to let you know that the following page renders correctly on my box:

http://www.n0t.de/main.php/view/user_bilder/hbtje/lfa2k4/IMG_0573.jpg?g2_imageViewsIndex=4

System configuration:

IE6 on Windows XP Professional w/SP2 (English)

Anything else I could help?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-01-28 20:59

doctormord, I still believe there's a misunderstanding here.

the main problem we're talking about is this:
1. go to http://www.n0t.de/main.php/view/user_bilder/hbtje/lfa2k4/?g2_page=1
2. resize your browser window, make it quite narrow (decrease the width)
-> effect:
thumbnails drop below the sidebar.

 
thumb
thumb's picture

Joined: 2004-05-26
Posts: 238
Posted: Fri, 2005-01-28 21:15

Just to be sure, doctormord, have you been testing on all of your G2 views, or just on the view image pages? Can you test with a narrow window when viewing an album with several thumbnails? When I view the page that matches the screen shot you posted, everything's okay. But when viewing your album pages with thumbnails, the table with the thumbnails wrap.

This problem was not part of previous versions of G2 alpha, and I've been out of things for a few months. It will probably be a simple fix once I find the time to investigate.

If anyone comes across the fix, please share :)

 
doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Sat, 2005-01-29 11:36

thumb70, i only fixed it for the image-view. When you browse the thumbnails and narrow the browser, then the table will get wrapped, thats right. :)

I'll fix it for the thumbnail-view too, stay tuned.

 
thumb
thumb's picture

Joined: 2004-05-26
Posts: 238
Posted: Sun, 2005-01-30 21:52
doctormord wrote:
I'll fix it for the thumbnail-view too, stay tuned.

Cool. Thanks for taking a stab at it. Even if you don't get it, share what you tried to help us all out :)

 
doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Mon, 2005-02-07 18:07

I fixed it for the album-view too now. :)

Basicly its the same tweaking like in the image-view.

albumBody.tpl.local

{*
 * $Revision: 1.59 $ $Date: 2004/11/23 01:08:12 $
 * If you want to customize this file, do not edit it directly.
 * Instead, copy it to albumBody.tpl.local and edit that version instead.
 * Gallery will look for that file first and use it if it exists
 * and when you upgrade, your changes will not get overwritten.
 *
 * To Do:
 * 1. Figure out how to get Gallery homepage to display album items that span full width of browser window.
 * 2. Reconsider albums in a single td... 
 *
 *}

{include file="gallery:layouts/matrix/templates/pathbar.tpl"}

<div id="gsContents" style="position:absolute; top:91px; left:10px; width:180px; z-index:1;">
  {include file="gallery:templates/sidebar.tpl"}
</div>

<div id="gsAlbumContents" style="position:absolute; top:91px; left:190px; z-index:2; width:auto; height:auto;">
    
    <div class="gbTopFlag">
      <table class="gbTitleBanner">
        <tr>
          <td>
            <h1 class="giTitle">
              {$layout.item.title|default:$layout.item.pathComponent|markup}
            </h1>
            <p class="giDescription">
              {$layout.item.description|markup}
            </p>      
          </td>
  
          <td>
            <ul class="giInfo">
              <li>
                {capture name=creationTimestamp}
                {g->date timestamp=$layout.item.creationTimestamp}
                {/capture}
                {g->text text="Date: %s" arg1=$smarty.capture.creationTimestamp}
              </li>
    
              <li>
                {g->text one="Size: %d item" many="Size: %d items"
                         count=$layout.childCount arg1=$layout.childCount}
                {if $layout.descendentCount > $layout.childCount}
                  {g->text one="(%d item total)" many="(%d items total)"
                           count=$layout.descendentCount arg1=$layout.descendentCount}
                {/if}
              </li>    
              {if $layout.showAlbumOwner}
              <li>
                {g->text text="Owner: %s" arg1=$layout.owner.fullName|default:$layout.owner.userName}
              </li>
              {/if}
            </ul>
          </td>
        </tr>
      </table>
    </div>
    
    <div class="gbNavBar">
      {include file="gallery:layouts/matrix/templates/itemNavigator.tpl"}
    </div>
    
    {if count($layout.children) > 0}
    {assign var="childrenInColumnCount" value=0}
    <table id="gbThumbMatrix">
      <tr>
        {foreach from=$layout.children item=child}

        {* Move to a new row *}
        {if ($childrenInColumnCount == $layout.columnSize)}
      </tr>
      <tr>
        {assign var="childrenInColumnCount" value=0}
        {/if}

        {assign var=childrenInColumnCount value="`$childrenInColumnCount+1`"}
        <td class="{if $child.canContainChildren}gbItemAlbum{else}gbItemImage{/if}" 
            style="width: 10%">
          <div class="giThumbImage">
	    {capture name="link"}<a href="{g->url arg1="view=core:ShowItem"
						  arg2="itemId=`$child.id`"}">{/capture}
	    {if $child.canContainChildren}
	      {assign var=frameType value="albumFrame"}
	    {else}
	      {assign var=frameType value="itemFrame"}
	    {/if}
	    {if isset($layout.frame.$frameType) && isset($child.thumbnail)}
	      {include file=$layout.frame.template ImageFrame_data=$layout.frame.data
		       ImageFrame_frame=$layout.frame.$frameType item=$child image=$child.thumbnail
		       ImageFrame_pre=$smarty.capture.link ImageFrame_post="</a>"}
	    {else}
	      {$smarty.capture.link}
              {if isset($child.thumbnail)}
              {g->image item=$child image=$child.thumbnail}
              {else}
              {g->text text="no thumbnail"}
              {/if}
	      </a>
	    {/if}

            {if !empty($child.itemLinks)}
            <select onchange="{literal}javascript:if (this.value) { newLocation = this.value; this.options[0].selected = true; location.href= newLocation; }{/literal}" class="giActionSelect">
              <option label="{if $child.canContainChildren}{g->text text="&amp; album actions &amp;"}{else}{g->text text="&amp; item actions &amp;"}{/if}" value="">{if $child.canContainChildren}{g->text text="&amp; album actions &amp;"}{else}{g->text text="&amp; item actions &amp;"}{/if}</option>

              {foreach from=$child.itemLinks item=link}
              <option label="{$link.text}" value="{$link.url}">{$link.text}</option>
              {/foreach}
            </select>
            {/if}
          </div>

          <h2 class="giTitle">
            {if $child.canContainChildren}
            {g->text text="Album: %s" arg1=$child.title|default:$child.pathComponent|markup}
            {else}
            {$child.title|default:$child.pathComponent|markup}
            {/if}
          </h2>

          <p class="giDescription">
            {$child.summary|entitytruncate:256|markup}
          </p>

          <ul class="giInfo">
            <li>
              {if !empty($layout.useCaptureDate) && isset($child.captureTimestamp)}
              {capture name=childTimestamp}{g->date timestamp=$child.captureTimestamp}{/capture}
              {else}
              {capture name=childTimestamp}{g->date timestamp=$child.creationTimestamp}{/capture}
              {/if}
              {g->text text="Date: %s" arg1=$smarty.capture.childTimestamp}
            </li>
            
            {if ($child.canContainChildren && $layout.showAlbumOwner) || (!$child.canContainChildren && $layout.showImageOwner)}
            <li>
              {g->text text="Owner: %s"
                       arg1=$layout.ownerMap[$child.ownerId].fullName|default:$layout.ownerMap[$child.ownerId].userName}
            </li>
            {/if}

            {if ($child.canContainChildren && $child.childCount > 0)}
            <li>
              {g->text one="Size: %d item" many="Size: %d items"
                       count=$child.childCount arg1=$child.childCount}
              {if $child.descendentCount > $child.childCount}
                {g->text one="(%d item total)" many="(%d items total)"
                         count=$child.descendentCount arg1=$child.descendentCount}
              {/if}
            </li>
            {/if}

            {if ($child.viewCount > 0)}
            <li>
              {g->text text="Views: %d" arg1=$child.viewCount}
            </li>
            {/if}

            {foreach from=$child.itemSummaries item=summary}
            <li>
              {$summary}
            </li>
            {/foreach}

          </ul>
        </td>
        {/foreach}

        {* flush the rest of the row with empty cells *}
        {section name="flush" start=$childrenInColumnCount loop=$layout.columnSize}
        <td>&amp;</td>
        {/section}
      </tr>
    </table>
    {else}
    <div id="gsStatus">
      <p class="giEmpty">
      {g->text text="This album is empty."}
      </p>
    </div>
    {/if}

    {if !empty($layout.itemDetailFiles)}
    {foreach from=$layout.itemDetailFiles key=moduleId item=detailFile}
    {include file="gallery:$detailFile" l10Domain="modules_$moduleId"}
    {/foreach}
    {/if}

    <div class="gbBottomFlag">
      <div class="gbNavBar">
        {include file="gallery:layouts/matrix/templates/itemNavigator.tpl"}
      </div>
      <ul class="giHorizontalLinks">
        {if !empty($layout.jumprange)}
	<li>{g->text text="Page:"}</li>
	{/if}
        {assign var="lastPage" value=0}
        {foreach name=jumprange from=$layout.jumprange item=page}
        {if ($page - $lastPage >= 2)}
        <li>
          {if ($page - $lastPage == 2)}
          <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$layout.item.id`" arg3="page=`$page-1`"}">{$page-1}</a>
          {else}
          ...
          {/if}
        </li>
        {/if}

        {if ($layout.currentPage == $page)}
        <li class="giSelected">
          {$page}
        </li>
        {else}
        <li>
          <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$layout.item.id`" arg3="page=$page"}">{$page}</a>
        </li>
        {/if}
        {assign var="lastPage" value=$page}
        {/foreach}
      </ul>
    </div>
</div>

The important part is the following:

<div id="gsContents" style="position:absolute; top:91px; left:10px; width:180px; z-index:1;">
  {include file="gallery:templates/sidebar.tpl"}
</div>

<div id="gsAlbumContents" style="position:absolute; top:91px; left:190px; z-index:2; width:auto; height:auto;">

Just set the sidebar in its own <div></div> and put the rest in a second.
Then remove one </div> at the end, because we dont need it anymore.

:)

The sidebar got tweaked at the top of this thread.

Excuse my english, i hope you understand me. :oops:

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-02-07 18:14

doctormord, you're great!

It works in Firefox 1.0, IE6 SP2, Opera 7.11.

The link to the album is: http://www.n0t.de/main.php/view/photos/urban/urban_berlin/

thumb70, commit that thing :)

(now you only need to fix the overflow thingy ;) )

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-02-07 18:40

doctormord, that is a good workaround but I don't think it's a good long term solution. valiant, if you look closely you'll see this is using absolute positioning of the main content block.. as soon as someone modifies their global.tpl with a custom header they will complain how the content covers the header! You can even see the problem in the link above by making the window skinny enough that the breadcrumb line-wraps...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-02-07 18:56

mindless, ah, don't be such a killjoy :)
No, of course you're right. But experience has shown, that we're very close to the solution, just combine this fix without absolute positioning with something else :)

Oh well, maybe not :(

 
doctormord
doctormord's picture

Joined: 2005-01-26
Posts: 63
Posted: Mon, 2005-02-07 18:56

sure, its just a work-around. But its possible to get it "real-work" when you also setup the global.tpl to "position"-thingies. An other way is to do it with position:relative and those stuff. There is also another way to format html via css-tables". That arent real tables, but they work like a real table, just with css-cmds. They're good for formating XML-Data.

Basicly, you need to "rewrite" the Design-Enginge... :o

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-02-07 19:01

@absolute positioning is quite a no-no, just think about embedded G2 (or google why absolute positioning is bad...).

@css-tables: IMO building tables with css is absolute pointless. what will you have achieved? a <ul> element that behaves like a <tr> and so on, great. it's only a tiny bit more semantically correct.

it would be great if you could achieve the same result without absolute positioning!

 
thumb
thumb's picture

Joined: 2004-05-26
Posts: 238
Posted: Mon, 2005-02-07 22:25

Hey, doctormord, nice work. I haven't reviewed it detail, but I think we'll get a permanent solution out of this that takes the hacks and absolute positioning considerations into account.

I believe a combination of CSS updates with some shifting of how elements are nested in the HTML markup will correct this problem. I've been so focused on CSS fixes that I haven't considered the impact of div container relationships within the document.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-03-06 10:03

what's the status on this?
a fix for this and the overflow in embedded G2 are requested again and again...

 
Makc666
Makc666's picture

Joined: 2003-12-26
Posts: 78
Posted: Sun, 2005-03-06 15:17

mindless, are you going to make this fix your self in next version of G2?
Because the current situation awful.
Thanks.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-03-06 15:51

Makc666, thumb70 (not mindless) is working on this issue and of course we try hard to fix all the problems and keep improving G2. But there's no guarantee that it will be fixed in the next beta release.

 
Makc666
Makc666's picture

Joined: 2003-12-26
Posts: 78
Posted: Sun, 2005-03-06 16:06

valiant, just you understand why I asked.
I am planing to migrate from G1 to G2 now step-by-step.
I am not going to show this G2 for users, just for me in current stage.
But I must be shure that in final G2 this problem will be fixed.
That's why I asked this question.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2005-03-07 04:06

Yes, this will be fixed eventually. But since we have practically nobody on our UI team, it's going to take a while.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-03-07 17:36

so, i've finally actually taken a look at this.. here's my take:
the sidebar and main content in matrix layout use css floats.. each is float:left, sidebar is width:20% and content is width:78%.. as this total width is < 100% then gecko based browsers won't wrap the content down below the sidebar, even if album content overflows the 78% width. I guess IE expands the content container when the content overflows and it decides to wrap and place it below the sidebar.
Here's an alternate strategy that may work.. maybe people can try it on various browsers and give feedback.
In templates/layout.css.php change:

#gsSidebar, #gsAdminSidebar {
        float: left;
        width: 20%;
}

#gsAlbumContents, #gsAdminContents, #gsOtherContents {
    float: left;
    width: 78%;
}

to:

#gsSidebar, #gsAdminSidebar {
        display: table-cell;
        vertical-align: top;
        padding-right: 1em;
}

#gsAlbumContents, #gsAdminContents, #gsOtherContents {
    display: table-cell;
    vertical-align: top;
}

These two blocks aren't actually right next to eachother in the file.. just edit each where you find them. This strategy makes the two divs behave like table cells so they don't wrap.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-03-07 17:49

oops, looks like IE doesn't recognize display:table-cell.. oh well.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-07 17:51

Makes things worse!
Before:
Firefox: Content didn't wrap down if window was very small.
IE6: Content did wrap down if window was very small.

With changes:
Firefox: Content wraps down even if window is very very wide. And it's quite unstable. If I activate the webdeveloper extension of firefox, and make the css and box borders visible, suddenly the content is where it should be, well nearly where it should be.
IE6: Content wraps down even if window is very very wide AND the horizontal lines (<hr>) of the sidebar are as wide as the whole monitor/window.

 
FlamingFoo

Joined: 2005-03-09
Posts: 14
Posted: Fri, 2005-03-11 06:34

I do not think there is a way to make IE behave without going back to table for laying out these two columns. Absolute positioning will mess up people's footers and headers. Float-based layout will fail since IE expands containers to fit contents. We should go back to table for this part, and hand out free pitchforks and Redmond maps to those who complain.