1
Xman04
Block positioning
  • 2006/7/23 2:29

  • Xman04

  • Not too shy to talk

  • Posts: 180

  • Since: 2004/7/12


Hi,

Anytime I set two blocks side by side (left center and right center), both blocks are pushed to the bottom of the page below all of the center blocks. XOOPS seems to ignore how I weight the position of those blocks, and always pushes them to the bottom below the center blocks.

Am I doing something wrong? I've seen other sites where the left center and right center blocks can be positioned anywhere relative to any center blocks on the page. I can't figure how to control this.

Any help would be appreciated.

Thanks,
Dave

2
jensclas
Re: Block positioning

Quote:
Am I doing something wrong? I've seen other sites where the left center and right center blocks can be positioned anywhere relative to any center blocks on the page. I can't figure how to control this.


I don't think so...depending on your version...if it is anything up to 2.0.13 then sorry this is the way it is...2.0.14 - I don't know

2.2 I think you should be able to do it but this version is not a recomended one...but some people use it happily...

Do a search on center block positions and you should find specific information...I know I had this problem with 2.0.13 but I haven't upgraded to 2.0.14 yet to see if it is a possibility..sorry i can't be more specific off the top of my head...I don't have time to search the posts for you.

3
javelin
Re: Block positioning
  • 2006/7/23 21:21

  • javelin

  • Not too shy to talk

  • Posts: 160

  • Since: 2004/3/11


I was given this the other day which did it for 2.0.14

Insert in theme.html in place of the center column.

Quote:

<td id="centercolumn">
<!-- Display center blocks if any -->
<{if $xoops_showcblock == 1}>
<table cellspacing="0">
<tr>
<td id="centerLcolumn">
<!-- Start center-left blocks loop -->
<{foreach item=block from=$xoops_clblocks}>
<{include file="default/theme_blockcenter_l.html"}>
<{/foreach}>
<!-- End center-left blocks loop -->
</td>
<td id="centerRcolumn">
<!-- Start center-right blocks loop -->
<{foreach item=block from=$xoops_crblocks}>
<{include file="default/theme_blockcenter_r.html"}>
<{/foreach}>
<!-- End center-right blocks loop -->
</td>
</tr>
<tr>
<td id="centerCcolumn" colspan="2">
<!-- Start center-center blocks loop -->
<{foreach item=block from=$xoops_ccblocks}>
<{include file="default/theme_blockcenter_c.html"}>
<{/foreach}>
<!-- End center-center blocks loop -->
</td>
</tr><{/if}>
</table>
<!-- End display center blocks -->
<div id="content"><{$xoops_contents}></div>

<{if $xoBlocks.page_bottomleft or $xoBlocks.page_bottomright or $xoBlocks.page_bottomcenter}>
<table cellspacing="0">
<{if $xoBlocks.page_bottomcenter}>
<tr>
<td id="centerCcolumn" colspan="2">
<{foreach from=$xoBlocks.page_bottomcenter item=block}><{include file="default/theme_blockcenter_c.html"}><{/foreach}>
</td>
</tr>
<{/if}>
<{if $xoBlocks.page_bottomleft or $xoBlocks.page_bottomright}>
<tr>

<td id="centerLcolumn">
<{foreach from=$xoBlocks.page_bottomleft item=block}><{include file="default/theme_blockcenter_l.html"}><{/foreach}>
</td>

<td id="centerRcolumn">
<{foreach from=$xoBlocks.page_bottomright item=block}><{include file="default/theme_blockcenter_r.html"}><{/foreach}>
</td>
</tr>
<{/if}>
</table>
<{/if}>
</td>


The issue is that in newbb it loses the left column.
Not sure why yet.

Perhaps a guru out there can help?
I might not be very clever but I can lift heavy weights!

4
Xman04
Re: Block positioning
  • 2006/7/24 6:33

  • Xman04

  • Not too shy to talk

  • Posts: 180

  • Since: 2004/7/12


Hi Jensclass and Javelin,

I did search the posts, but didn't find anything that solved the problem. This is why I posted here for help.

I've seen some suggestions for modifying the theme.html, but that doesn't give much flexibility, especially if you are frequently adding and repositioning blocks quite a bit.

Ideally, we should be able to position the left-center and right-center blocks anywhere we want relative to the center blocks (and vice versa). However, it seems that the block weighting is only relevant to the section that the block resides in (sections = left, right, center, left-center, right-center, right, etc.) In other words, the weights applied to center blocks will only position those blocks relative to other center blocks, and the weights for left-center or right-center blocks only apply to those particular sections. The actual sections seem to be positioned according to the way the theme.html file is coded. I'm not sure if I'm 100 percent right about this, but that is how it seems to be.

I know that the 2.0.14 upgrade is supposed to allow more flexibility in positioning blocks, but I'm very vague on what this really means. I've not found a post, FAQ, or documentation that explains this in more depth.

Dave

5
metropolis
Re: Block positioning
  • 2006/7/24 8:40

  • metropolis

  • Not too shy to talk

  • Posts: 159

  • Since: 2004/7/15


Quote:

Xman04 wrote:
right-center, right, etc.) In other words, the weights applied to center blocks will only position those blocks relative to other center blocks, and the weights for left-center or right-center blocks only apply to those particular sections. The actual sections seem to be positioned according to the way the theme.html file is coded. I'm not sure if I'm 100 percent right about this, but that is how it seems to be.

Yes, you are right.

If you take a look into the (default) theme.html you can see that (for the bottom blocks) there is first a loop within ALL center blocks (meaning all center blocks will be printed according to there weight) and after that the left and right centerblocks will be printed out according to their weight.

If it should work the way you (and me, and probably all) would like, there has to be an outer loop for all center blocks that loops over all center blocks' block-weight.

From a programming point of you, that should work, but I have no idea about the XOOPS internals and whether there is such a general weight variable to loop over.

6
Xman04
Re: Block positioning
  • 2006/7/24 18:35

  • Xman04

  • Not too shy to talk

  • Posts: 180

  • Since: 2004/7/12


Hi Metropolis and everyone,

After I read your reply, I looked more closely at the default theme.html file, and more clearly understood the logic behind the bottom block feature (added to 2.0.14).

The left-center and right-center blocks will always be positioned below the center blocks, regardless of how you set the weights(at least through version 2.0.14). However, with the added bottom block positions, there is a way to position a set of left-center/right center blocks between the top and bottom center blocks, and have more left-center/right-center blocks at the bottom of the page too. This can be done just by using the top/bottom positions and weights in the blocks administration section of the system module.

Basically, the top left-center and top right-center blocks will always render below the top center blocks, and the bottom left-center and bottom right-center blocks will always render below the bottom center blocks. However, any bottom center blocks will be positioned below any top left-center and top right-center blocks, which basically gives you the ability to have top left-center and top right-center blocks positioned between the highest weighted top center block and lowest weighted bottom center block.

I'm probably not stating anything that many others have not already figured out, but it is just now making sense to me (especially after looking more closely at where the theme.html file renders the different block sections). As you said, it would be more flexible if there was one big outer loop that controlled all the center blocks. However, I think that 2.0.14 is a big improvement in positioning flexibility. Maybe future XOOPS versions will make the positioning even more flexible with the idea you suggested.

Dave

7
snow77
Re: Block positioning
  • 2006/7/24 19:15

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


@javelin:

Quote:

The issue is that in newbb it loses the left column.
Not sure why yet.


What do you mean by this? All the themes I've done are already updated for 2.0.14 and none of them loses the left column. That does look like the center content code for 2.0.14, maybe you are having a problem with theme you are using, the theme Blue Shine will be shortly published with the new make over, you will see all columns and blocks work ok with the 2014 theme code, you can check it out in the next following hours from xoopsdesign.com where you'll be able to download the theme and see it installed at a demo site.

@Xman04:

Quote:

The left-center and right-center blocks will always be positioned below the center blocks, regardless of how you set the weights(at least through version 2.0.14).


Yes, as far as I know it is like this, only that with 2.0.14 you have the option to place the blocks below or above the module content.

Yet you can move the html code and place the center center block code below the center-left/center-right blocks.

There are additional improvements to block positioning which is something very new, where you can define in the theme [lcr] in any combination you like and it will give you a new render of the blocks, it is rather complicated for me to explain any further but you can see a living example of this in the theme Zeta Reticuli, this will eventually take greater force and be applied more in the near future.
www.polymorphee.com
www.xoopsdesign.com

Login

Who's Online

239 user(s) are online (145 user(s) are browsing Support Forums)


Members: 0


Guests: 239


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits