SimplePortal

Customization => Themes and Graphics => Topic started by: Nick on August 10, 2010, 10:39:17 AM

Title: Moving the block
Post by: Nick on August 10, 2010, 10:39:17 AM
Ok so i have finally reached the end of perfecting my portal and i'm stuck on the last part! Heres how my portal looks at the moment.

http://www.profifaleagues.net/index.php

If you scroll near the bottom you will see a big gap and then the users online section. I want that moved up (To see view the attached images). I figure it will need to be a right block with a custom size. I have tried adding it to the right and custom sizing it but all ways i have tried fails. I have worked out the block will come to a size of 860px, but like i said all ways i try fails.

Would be very grateful for help on this and thankyou very much for reading.

Title: Re: Moving the block
Post by: AngelinaBelle on August 10, 2010, 03:14:39 PM
You have put this block outside of the row where the left, center, and right sp_blocks go.
It cannot float up to fill any spaces inside this row.
 
Even if you made this a left, center, or right block, the float you are attempting to achieve would be hampered by the fact that the blocks are within left, center, and right columns within the row.
 
SimplePortal uses tables to keep center, left, and right blocks where they belong.
And floating divs are not going to float the way you want them to between different cells of the table.  This behavior may even be browser-dependant.
 
If you could put the block at the bottom of the right blocks, and used some absolute positioning to move it as far left as you like, you might achieve the effect you are looking for.  I imagine this could be a frustrating exercise, and may be browser dependant.
 
Title: Re: Moving the block
Post by: Nick on August 10, 2010, 04:18:39 PM
Well i did change the size of all right blocks to allow up to 860px then pust custom sizes of 250px for each right block then put the online block as 860 (on the right aswell) but even though i tried to add 590px to the center blocks so they wernt all squashed up and like 50px as they were, they didnt change. Thats the closest i got then i ran out of ideas. I used the following code;

float:right; width:860px;
or
float:left; width:860px;
Title: Re: Moving the block
Post by: AngelinaBelle on August 10, 2010, 04:43:43 PM
Float will not work in this case.
This is because the left, center, and right blocks are in one table row and the "Forum Stats" are in a table row that comes AFTER all of those things.
 
Float cannot force it to start higher on the page than the bottom of the lowest-reaching part of the previous row.
 
You can look at the HTML of the page to see the table structure of the page.
 
If you put that Forum Stats block in a right block, you could get it to start right under the Top Managers block.
 
What you need is absolute positioning.  This can allow an element to overlap other elements without affecting their flow. Then, you can set the block's width however you want, and it should not affect the width of the right column.  At least in browsers that follow this rule! You need to give the block a non-static parent element, which you might do using block-within-a-block. Absolute blocks are always positioned relative to their nearest non-static parent. That means the parent must be absolute, relative, or fixed. Relative positioning is probably what you want for the parent element.   http://www.w3schools.com/css/css_positioning.asp (http://www.w3schools.com/css/css_positioning.asp)
 
Getting the effect you want here could be very time-consuming.  You will learn a little bit about CSS positioning in the process, which will be valuable if you want to do other types of fancy CSS layout in the future.  But you might also wind up concluding the reward is not worth the effort you have put in.
Title: Re: Moving the block
Post by: Nick on August 10, 2010, 05:13:55 PM
Well i tried to use CSS to change the block size with help from Nathaniel but nothing happened when i added css.

http://simpleportal.net/index.php?topic=6025.0
Title: Re: Moving the block
Post by: Nick on August 10, 2010, 06:20:51 PM
Thankyou followed what you said and it worked. At least on my screen it looks like it has;

http://www.profifaleagues.net/index.php

Thanks :)
Title: Re: Moving the block
Post by: AngelinaBelle on August 10, 2010, 07:09:39 PM
It does work -- if the screen width is just right.
In IE8, if you make the screen more narrow, the block is now too wide.
 
If you make the div with id="wrapper" to be a fixed width, this may work out more reliably for you.
Title: Re: Moving the block
Post by: Nick on August 13, 2010, 06:12:16 AM
I tried various ways use the div wrapper but had no luck, i know what you mean about resolution though. The current formatting that block uses at the moment is;

Code: [Select]
width:53%; position:absolute; top:1140px;
Tried adding the <div id="wrapper"></div> but it moved the block up and changed the width.
Title: Re: Moving the block
Post by: smosmo on August 13, 2010, 12:29:07 PM
You have to give your <div id="wrapper"> a fixed width. Your website will scale with anybody's resolution right now which will screw up your layout. You want to control this by giving your website a fixed width and then readjusting the positioning of your block correctly. That way everyone will be viewing it the same way.
Title: Re: Moving the block
Post by: Nick on August 14, 2010, 05:13:15 PM
So where should i be adding this? Display.template ?
Title: Re: Moving the block
Post by: Nick on August 15, 2010, 01:51:00 PM
I use FF on a 17-19" screen (Not sure on the size exactly)
Title: Re: Moving the block
Post by: smosmo on August 16, 2010, 01:06:00 PM
Yup, it appears to be in your index.template.php.

Change
<div id="wrapper" style="width: 81%;">
to
<div id="wrapper" style="width: ...px">

with ... being whatever size you'd think would be best of course :)
Title: Re: Moving the block
Post by: AngelinaBelle on August 17, 2010, 10:52:08 AM
Code: (find) [Select]
<div id="wrapper" style="width: 78%;">
Code: (replace) [Select]
<div id="wrapper" style="width: 1000px;">Ought to be about right for the content you currently have.
 
You migh consider doing this in the CSS file instead of in the template file, however.  It's easier
Code: (find) [Select]
<div id="wrapper" style="width: 78%;">
Code: (replace) [Select]
<div id="wrapper">
Code: (find [url) [Select]
http://www.profifaleagues.net/Themes/ISkin/css/index.css?rc2[/url]]
DIV#wrapper
{
   margin : 0px auto
}
Code: (replace) [Select]
DIV#wrapper
{
   margin : 0px auto
   width: 1000px
}
Title: Re: Moving the block
Post by: Nick on August 17, 2010, 02:11:52 PM
Isn't everthing your suggesting Angelina just to alter the width of the forum? I set it to 78% myself via the AdminCP
Title: Re: Moving the block
Post by: AngelinaBelle on August 18, 2010, 09:27:45 AM
Yes.
 
If you set the width to a percentage, then the appearance will change depending on the size of the window used to view it.
 
If you make the width fixed, you can control the appearance, so it still looks right no matter how wide the user makes the browser window.
 
But that might not be important, since you've changed the blocks around a bit...
Is there any way I can help you any more with your original question?
Title: Re: Moving the block
Post by: Nick on August 18, 2010, 04:03:22 PM
Nope everything is ok now thankyou.
SimplePortal 2.3.8 © 2008-2024, SimplePortal