News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

top template

Started by Evelyna, September 18, 2013, 11:50:32 PM

Previous topic - Next topic

Evelyna

Hey Guys.

I was wondering if there was a way I could use the empty space on top of the posts in the  posts pages to place a message.   I read one post and the person recommended using ad mod and then altering the template code.  I don't want to put up an ad ... just a message now and then.

Is that doable?

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Evelyna

This is the place I thought I would like to see messages.

It kinda seems like wasted space.

Sorry if the attachment is too small.


Cyberhost

What exactly are you trying to do there.. like images or just text?

Sir Osis of Liver


That's kind of a busy area, but the simplest (not the best) way to do it is just stick a <div> where you want it with absolute positioning.

Something like this in index.template.php -



// Show the menu here, according to the menu sub template.
template_menu();

echo '
<br class="clear" />';

echo '
<div style="position: absolute; top: 200px; left: 400px; width: 300px; height: 150px; z-index: 10; background: white; border: 2px red solid;">blah blah blah......................
</div>';

/// Show a random news item? (or you could pick one from news_lines...)



Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

really?   absolute positioning?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Evelyna

Quote from: Cyberhost on September 19, 2013, 12:57:18 AM
What exactly are you trying to do there.. like images or just text?

I was thinking just text.  If you had a message you wanted to put out to everyone who posted, you could put it there:  announcements maybe.

Evelyna

Quote from: Krash. on September 19, 2013, 01:12:20 AM
That's kind of a busy area, but the simplest (not the best) way to do it is just stick a <div> where you want it with absolute positioning.

Thank you.  I have to confess, I'm a little afraid of using absolute positioning.  I think there was even a caveat in my css tutorial about it.  Are you sure it's okay?

Matthew K.

There are definitely times to use it. However...my first question would be this: what happens if there are more menu buttons? Are you opposed to having it directly above or below the actual menu? That way the menu can flow however far it wants1 - like it should.

1. within reason of course...

Evelyna

I'm not opposed to it floating at all.  I could put a colored border around it maybe to set it apart while it floats.

Mick.

Consider user monitor sizes too

Evelyna

You mean in regards to absolute positioning?

Matthew K.

No, in regard to the menu stretching. It's designed with empty space there because buttons are on permissions - meaning that not everyone will see the same menu. Screen size also plays a part in how much of the menu takes.

Evelyna

Quote from: Labradoodle-360 on September 19, 2013, 01:13:07 PM
No, in regard to the menu stretching. It's designed with empty space there because buttons are on permissions - meaning that not everyone will see the same menu. Screen size also plays a part in how much of the menu takes.

I don't think I understand that.  Does that mean the space isn't really available, just sort a spacer? 


Evelyna

Quote from: Krash. on September 19, 2013, 01:12:20 AM

That's kind of a busy area, but the simplest (not the best) way to do it is just stick a <div> where you want it with absolute positioning.

Something like this in index.template.php -



// Show the menu here, according to the menu sub template.
template_menu();

echo '
<br class="clear" />';

echo '
<div style="position: absolute; top: 200px; left: 400px; width: 300px; height: 150px; z-index: 10; background: white; border: 2px red solid;">blah blah blah......................
</div>';

/// Show a random news item? (or you could pick one from news_lines...)



I tried this but got a parse error.

margarett

It means that the free space you see might not be the same other users see:
- regular users have more space because they don't have, eg, "Admin"
- depending in the users screen/resolution, they can have much more or much less space than you.

That's why usually banners are placed in the center below the menu ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Evelyna


Evelyna

Quote from: Krash. on September 19, 2013, 01:12:20 AM

That's kind of a busy area, but the simplest (not the best) way to do it is just stick a <div> where you want it with absolute positioning.


It works now.  Absolute positioning and all.

Sir Osis of Liver


Bear in mind it's sitting over the menu div.  If you add enough buttons, they'll be behind the new text div.  Absolute positioning is chancy because it may display differently in different screen res and browser zoom settings.  The better way to do it is to redesign that area, but that's another can of worms.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Evelyna

Quote from: Krash. on September 19, 2013, 03:52:26 PM

Bear in mind it's sitting over the menu div.  If you add enough buttons, they'll be behind the new text div.  Absolute positioning is chancy because it may display differently in different screen res and browser zoom settings.  The better way to do it is to redesign that area, but that's another can of worms.

Sounds crawly ... I noticed that by placing the bordered square where you located it, I had two rows of 'home, help. login, register's. 

I took it down and promised not to use absolute positioning unless I really knew what it was all about.

Maybe ad mod might work.

Is re-designing it hard to do?

Thanks guys.

Advertisement: