xoops forums

wingrider101

Not too shy to talk
Posted on: 2008/7/15 15:24
wingrider101
wingrider101 (Show more)
Not too shy to talk
Posts: 101
Since: 2004/5/26
#1

Block and Module "Weight" Values

I'm writing an article for my web site, and I need a little info that I can't find after searching the XO site pretty thouroughly. Knowing that some of you out there know the site a lot better than I, I thought I would pose the questions here.

1. What is (are) the minimum and maximum numeric values that can be put into the weight field in blocks configuration?
2. What is (are) the minimum and maximum numeric values that can be placed into the module weight field in module configuration?
3. In modules setting a value of 0 will cause the module to not be visible in the menu. Will setting a value of 0 in a block have any effect?

Thanks in advance for any help. I'm developing an admin module system to easily order blocks and menus, and an article to go along with it.

Byron
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Byron McKay
wingrider101 at gmail dot com
http://byron.homelinux.com
http://www.xoopstyro.com
-------------------------------------
Xoops CMS Intranet sites for Business
-------------------------------------

GPboarder

Friend of XOOPS
Posted on: 2008/7/15 22:12
GPboarder
GPboarder (Show more)
Friend of XOOPS
Posts: 248
Since: 2006/10/6
#2

Re: Block and Module "Weight" Values

Setting the weight of a block is like giving it a density. The more dense things sink to the bottom and the less dense ones float to the top. 0 in the blocks weight is the equivalent of saying that there is nothing pulling it down so therefore it will compete for the top location with other blocks having a weight of 0.

I just tested 10000 as a weight with no problems but can't tell you an actual limit.

There is a specific setting in the Blocks Administration area that determines if a block is visible or not. The weight does not affect the visibility.
Optimism is the mother of disappointment.

iHackCode

Module Developer
Posted on: 2008/7/15 23:20
iHackCode
iHackCode (Show more)
Module Developer
Posts: 1036
Since: 2004/6/29
#3

Re: Block and Module "Weight" Values

1. smallint(5) unsigned (Not Zero Fill), range: 0 - 65535

2. smallint(3) unsigned (Not Zero Fill), range: 0 - 65535

3. setting blocks to 0 weight makes it appear closer to the top. if two or more are zero, then the one with the lower blockid will appear closer to the top. the greater the number, the block will appear closer the to bottom, compared to other blocks.

==
note. smallint(5) and smallint(3) I don't know if it is phpmyadmin or what but since it is unsigned, they are just smallint. also the input for the text boxes have a limit on 5 characters that was coded.
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

wingrider101

Not too shy to talk
Posted on: 2008/7/16 14:05
wingrider101
wingrider101 (Show more)
Not too shy to talk
Posts: 101
Since: 2004/5/26
#4

Re: Block and Module "Weight" Values

Quote:

Bandit-X wrote:
1. smallint(5) unsigned (Not Zero Fill), range: 0 - 65535

2. smallint(3) unsigned (Not Zero Fill), range: 0 - 65535

3. setting blocks to 0 weight makes it appear closer to the top. if two or more are zero, then the one with the lower blockid will appear closer to the top. the greater the number, the block will appear closer the to bottom, compared to other blocks.

==
note. smallint(5) and smallint(3) I don't know if it is phpmyadmin or what but since it is unsigned, they are just smallint. also the input for the text boxes have a limit on 5 characters that was coded.


Thanks, that's exactly what I needed. I'm developing a module to select the blocks you want from a given section, and alphabetize them, in up or down order, or move them around a little easier. I'm also planning on having the modules move up and down the menu in the same way. I'm using weight as the simple way to do that.

In the interim, I thought I would just write up how it all works so that folks who are new to XOOPS can read up on it. The documentation so far leaves a lot to be desired on this one particular section.

This will be the first (of many I hope) articles on my new XOOPSTyro.com web site that I'm still developing.

As always, the community steps up! Thanks!

Byron
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Byron McKay
wingrider101 at gmail dot com
http://byron.homelinux.com
http://www.xoopstyro.com
-------------------------------------
Xoops CMS Intranet sites for Business
-------------------------------------

wingrider101

Not too shy to talk
Posted on: 2008/7/16 14:08
wingrider101
wingrider101 (Show more)
Not too shy to talk
Posts: 101
Since: 2004/5/26
#5

Re: Block and Module "Weight" Values

Quote:

GPboarder wrote:
Setting the weight of a block is like giving it a density. The more dense things sink to the bottom and the less dense ones float to the top. 0 in the blocks weight is the equivalent of saying that there is nothing pulling it down so therefore it will compete for the top location with other blocks having a weight of 0.

I just tested 10000 as a weight with no problems but can't tell you an actual limit.

There is a specific setting in the Blocks Administration area that determines if a block is visible or not. The weight does not affect the visibility.


Thanks! I like your density analogy. I'll use it in my article if you don't mind. I'm trying to really explain this in a way a XOOPS Newbie will get it.

Byron
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Byron McKay
wingrider101 at gmail dot com
http://byron.homelinux.com
http://www.xoopstyro.com
-------------------------------------
Xoops CMS Intranet sites for Business
-------------------------------------

Mamba

Moderator
Posted on: 2008/7/16 16:36
Mamba
Mamba (Show more)
Moderator
Posts: 10792
Since: 2004/4/23
#6

Re: Block and Module "Weight" Values

Quote:
This will be the first (of many I hope) articles on my new XOOPSTyro.com web site that I'm still developing.

Fantastic! We definitely need more documentation, so every article showing how to do things with XOOPS, is very helpful.

Thank you!
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

wingrider101

Not too shy to talk
Posted on: 2008/10/12 16:17
wingrider101
wingrider101 (Show more)
Not too shy to talk
Posts: 101
Since: 2004/5/26
#7

Re: Block and Module "Weight" Values

I have a partial document that I'd like some of you guru types to look over. If you can send me an e-mail at my e-mail address. I'll send you back a copy of the OpenOffice odt file I have so far.

I'd love to have some comments/suggestions/finger pokes etc on how I'm doing.

Thanks in advance.

Byron
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Byron McKay
wingrider101 at gmail dot com
http://byron.homelinux.com
http://www.xoopstyro.com
-------------------------------------
Xoops CMS Intranet sites for Business
-------------------------------------

Mamba

Moderator
Posted on: 2008/10/13 4:10
Mamba
Mamba (Show more)
Moderator
Posts: 10792
Since: 2004/4/23
#8

Re: Block and Module "Weight" Values

Email on the way
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs