News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Converting an ASP menu into PHP

Started by atomickarma, May 13, 2006, 04:13:21 PM

Previous topic - Next topic

atomickarma

Hi
I have a website at www.kasterborous.com - the top right of each page carries a navigation menu.  This site is in ASP, but due to space and db hits we're moving the forum to SMF.  A test version is available at www.doctorwhoforum.org.uk.  Immediately you will see the difference - we've successfully moved the forum, and introduced the website header into the index.template.php script, however the navigation menu I just cannot work out how to introduce.

I've used a converter to convert the ASP script of the navigation menu into PHP, but what then?  How to I tell the index.template.php file to display this menu?

Any help massively appreciated!
atomickarma

atomickarma

Little worried that no one has yet replied to this - have I hit upon a new issue?

Anyway, to update - by taking the raw HTML code for the menuat www.kasterborous.com, I have successfully integrated it into the index.template.php script, however I now have the problem of applying the css for the menu to this.

Obviously there is already a .css file applies to this page - is it possible to use multiple .css files?

B Patterson

Quote
Obviously there is already a .css file applies to this page - is it possible to use multiple .css files?
Yes, you can include as many as you want.  But beware, as the number of files grows and the size of the files grows, the longer download times.  So it may just behoove you to copy the declarations from one sheet to the other.

Also, note that if you have two stylesheets, and they contain the same style class or ID, the stylesheet included last will trump that of the previous sheet.

atomickarma

Cheers bpat1434

I've done as you suggested, pasted the css for the menu into the index.template.php along with the HTML representation of the menu from the page source of www.kasterborous.com

however by doing this, i'm unable to get the menu to stay fixed on www.doctorwhoforum.org.uk.  Resizing the page results in the menu being dragged out of place.

Now this menu is under exactly the same conditions as the one on www.kasterborous.com - apart from the fact that site is in asp and the SMF site is in php.

I can't see that being the cause of this inability to fix the menu in place - although i could be wrong! - does anyone have any suggestions?

B Patterson

<width="730px">
That's not a real HTML tag... but it's in your code...

Also, checking the CSS you have this in the #navigation:
margin: 0 0 0 94px;
Try just using : margin: 0; instead of what you have.

atomickarma

Quote from: bpat1434 on May 16, 2006, 09:37:13 AM
<width="730px">
That's not a real HTML tag... but it's in your code...

Also, checking the CSS you have this in the #navigation:
margin: 0 0 0 94px;
Try just using : margin: 0; instead of what you have.
I used both of those myself in an attempt to reproduce the original menu.  WIthout them it is spread across the window.

SHould I have been approaching the positioning of the menu in a different way perhaps?

Thanks for you help on this btw.

B Patterson

well, my guess is if you remove the margin or add a margin to the right it won't spread.

Okay... first thing you need to do: fix your code so it's HTML compliant... you've got open tags... unknown tags and such just floating around.... you open a column, but don't close it, same with rows and tables....

Fix your HTML first.... then we'll see about your layout issues if they're still not resolved...


atomickarma

Hi

I've used the count function in notepad++ to find the open tags that I couln't find by eye - I think they're all closed now.

B Patterson

Quote<width="730px">
That's not a real tag in HTML.....

The style is preferrable to be in the <head></head> of the document, and not in the body....

Quote</style>
It's closed twice... but only opened once :(

atomickarma

Hmm, don't know how I missed the </style>... the <width="730px"> was an addition I made weeks ago which obviously doesn't do anything.

I have tried to annotate all my changes - that one obviously escaped my attention!


B Patterson

Have you tried just putting it in a new table row under the header?  Make the new row have 1 column with a colspan of 2 and see what that gives you?  May be the only way.

It wouldn't hurt to try adding a width to the #navigation declaration, as well as where it should be positioned....

atomickarma

Thanks for your help on this - in the end I used the wrapper css instruction which sorted it!

the forum is now up and running, thanks again for your help!

Advertisement: