15
Quote:
There is nothing really talking against adding more block positions - except that no themes will support these positions.
This means that the no. 1 question asked in the forums - if we add more block positions - will be "Why won't my [block position] blocks show up???"
I agree with you here Mith.
Quote:
Adding new block positions is something I have wanted for a long time, but we will need some "fallback" measure for a theme to broadcast which positions it has available and perhaps let it define a default block position where all the blocks that are positioned on positions not in the theme will be put.
I've thought about this abit and I've come to the same conclusion. A theme needs to pass information back to XOOPS on what block positions (or zones) are available for use in a theme.
This way if a theme supports blocks (zones) above or below the content then the theme would advertise this and XOOPS would then list the available blocks in the block admin.
This could be accomplished by requiring such a theme to include say a zone.php file which registers with XOOPS available zones. This could be as simple as:
$themeZone->register(_AM_CENTERLEFT, ’theme_rcenter’,1);
$themeZone->register(_AM_CENTERRIGHT, ’theme_lcenter’, 2);
$themeZone->register(_AM_CENTER, ’theme_center’, 3);
$themeZone->register(_AM_CENTERDOWN, ’theme_dcenter’, 4);
Etc
.
.
Where register params are:
Param1 : The name to display in the blocks admin
Param2 : Smarty constant name.
Param3 : Value to store in database.
This is just an example of course and it remains to be seen if such a registration mechanism is sufficient (I hope it is).
This leaves the theme.html free of PHP registration code and the syntax remains sufficiently simple for theme designers to use.
If this general idea appears to be the right one then I could spend some time and see if I can develop a working example.