1
marcan
Blocks in center-left and center-right
  • 2004/2/14 17:00

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


If you set 2 blocks to be displaying respectively in center-left and center-right so they apperar side by side, they are always display after the blocks set to be display in center-center. Is there a way to have blocks in center-left and center-right to be displayed before blocks in center-center.

I don't know If I make myself clear... Anyway, does someone have an idea?

Thanks for any help !

2
Mithrandir
Re: Blocks in center-left and center-right

The positioning of blocks relative to each others is set in theme.html in themes/[yourtheme] - don't do this with the default theme, though. Copy it to a new folder, rename all occurences of "default" in theme.html to the name of the new folder and change the block positions. Upload it and select it in preferences.

3
Jan304
Re: Blocks in center-left and center-right
  • 2004/2/14 17:14

  • Jan304

  • Official Support Member

  • Posts: 520

  • Since: 2002/3/31


Ofcourse this is possible. Check theme.html, and make sure that the parts:
<{foreach item=block from=$xoops_clblocks}>
and
<{foreach item=block from=$xoops_crblocks}>
comes before:
<{foreach item=block from=$xoops_ccblocks}>

Edit: I see that Mithrandir already replied, sorry for double post.

4
kahumbu
Re: Blocks in center-left and center-right
  • 2004/2/14 17:31

  • kahumbu

  • Documentation Writer

  • Posts: 277

  • Since: 2003/8/23


Just to add, it is also important to consider the position of the module content after the blocks have been moved. As default, content is below all the blocks. If you have center blocks in newbb, they will appear on top of the forums.

The content is identified by this short piece of code:
<div id="content">
    <{
$xoops_contents}>
div>

5
marcan
Re: Blocks in center-left and center-right
  • 2004/2/14 20:06

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


Many thanks People !

6
marcan
Re: Blocks in center-left and center-right
  • 2004/2/23 14:38

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


Quote:
Check theme.html, and make sure that the parts:
<{foreach item=block from=$xoops_clblocks}>
and
<{foreach item=block from=$xoops_crblocks}>
comes before:
<{foreach item=block from=$xoops_ccblocks}>

I've done this. However, doing this makes the clblocks and the crblocks to always be displayed before ccblocks.

Now, what I need to do is the folowing, in that very order :

- A welcome block in center_center
- The Recent web Links in center_left
- The Recent Downloads in center_right
- The Recent Topic in center_center
- The Recent Comments in center_center

How can I achieve this ?

Thanks for any help !

7
DobePhat
Re: Blocks in center-left and center-right
  • 2004/2/23 14:48

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


Everyone is correct of course in the beginning....
Marcan..I have done what you are doing....


In the theme.html....

you can move the cl and crblock code before the CBlock code....
ie:
<{if $xoops_showcblock == 1}> <{foreach item=block from=$xoops_clblocks}> <{include file="default/theme_blockcenter_l.html"}> <{/foreach}>  <{foreach item=block from=$xoops_crblocks}> <{include file="default/theme_blockcenter_r.html"}> <{/foreach}>


This will ALWYAS have em displayed first...you need also to go to block admin and set the weight...

but this will make it so that all your CR and CLBlocks will always be before Your CENTER BLOCKS...which is kewl for awhile

But then becomes a bit limiting...because all your CR and CL blocks will have to be before any CENTER BLOCKS...(including Spotlight)

Thats the only problem....
it is fixable, I bet...I just havent (figure'd it yet)

8
Mithrandir
Re: Blocks in center-left and center-right

I guess it is possible to have the first x center-center blocks shown before center-right and center-left and then the rest of the center-center blocks shown after that or after the main contents.

This, however, will include some Smarty programming, which I am not entirely sure is a good idea

Smarty is great for looping through complete arrays, but not very suited for while and for loops

something you could do is:
<{if $xoops_showcblock == 1}>
    <{
counter name='centerblockcount' assign='centerblockcount'}>
    <{foreach 
item=block from=$xoops_clblocks}>
        <{if 
$centerblockcount 5}> //or how many blocks you want displayed
            
<{include file....}>
        <{/if}>
        <{
counter}> //increment counter
    
<{/foreach}>
<{/if}>

Then insert the code for the center-left and center-right blocks and main contents if you want before this snippet:
<{if $xoops_showcblock == 1}>
    <{
counter name='centerblockcount2' assign='centerblockcount2'}>
    <{foreach 
item=block from=$xoops_clblocks}>
        <{if 
$centerblockcount2 5}> //notice: now LARGER than
            
<{include file....}>
        <{/if}>
        <{
counter}>
    <{/foreach}>
<{/if}>

There may be a smarter way to do this - I'm just whipping this up fast. If there are problems with it, it is most likely due to mistypings - check out http://smarty.php.net for correct syntax

9
mktwain124
Re: Blocks in center-left and center-right
  • 2004/2/23 15:53

  • mktwain124

  • Just popping in

  • Posts: 44

  • Since: 2002/9/27


Here's another way which has worked for me. I wanted to display the same thing, so I put the following code into my theme.html file, right after the call to display the left column:

<td id="centercolumn">
  <{if 
$xoops_showcblock == 1}>
    <
table cellspacing="0">
      <{if !
$xoops_isuser}>
    <
tr>
      <
td id="centerTopcolumn" colspan="2">
      <{
php}>include("uploads/topblock_guest.html");
      <{/
php}>
      td>
    tr>
    <
tr>
      <{/if}>
        
      <{if 
$xoops_isuser}>
        <
tr>
          <
td id="centerTopcolumn" colspan="2">
          <{
php}>include("uploads/topblock_user.html");
      <{/
php}>
          td>
        tr>
        <
tr>
      <{/if}>
    <
tr>

*** and 
then normal call to centerLcolumncenterRcolumn and centerCcolumnThe ending  is at the end of the centercolumn section ***

Then I put the 2 html files in my uploads folder. This way there is a different first block to display depending whether visiter has logged in or not. Also, if you don't want the block to display, you can have a blank html with the same name, rather than having to recode your theme.html file.

BTW, my homepage is set to None, but I've tested this with it set to News and Forums and it still works. Hope this helps.



10
marcan
Re: Blocks in center-left and center-right
  • 2004/2/23 15:59

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


All of you : Thanks for all the Help !

Login

Who's Online

454 user(s) are online (356 user(s) are browsing Support Forums)


Members: 0


Guests: 454


more...

Donat-O-Meter

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

Latest GitHub Commits