Wrapped SMF, theme <head> and mambo template???

Started by vavroom, June 07, 2005, 07:05:20 AM

Previous topic - Next topic

vavroom

Just realised that using the modified SMF theme I have for my wrapped forum, I end up with two <html>, two <head> and two <body>.  This appears to work, but doesn't make sense to me.  Or rather, it seems that to be "right", it shouldn't have two sets.  Any thoughts on pros and cons to this?

If I wanted to remove it, any thoughts on what I should do to properly link the css, call the few variables called through javascript, etc that are found in the "usual" templates?

Would appreciate your thoughts on this.

Thanks
Nic
The longer you stare at the screen, the blanker it gets...

Kindred

well, you can't just remove it....
Unlike the button menu or the footer stuff, the head and body tags are important and the stuff in them is even more so...

So, you'll need to include them in a php IF statement... (and include the closing tags in one as well)  and also copy the stuff out of the SMF head tags and into the mambo head tags.

it's a little more complicated than what I just wrote, but that's the essential task...
Сл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."

vavroom

Hmmm, right.  This looks like it migth be more than I can chew, particularly the IF statement (I tried to use the one you suggested in another thread and it didn't work :( ).  I'll leave it as is then, since it doesn't appear to be causing too much trouble.

Though seems to me that it's something that should be considered and a "standard" way devised for those wanting to integrate their templates/forum "properly" :)

Thanks for the heads up though (pun intended) ;)
Nic
The longer you stare at the screen, the blanker it gets...

Kindred

well, the problem with "standard" is that we all have different templates for both mambo and SMF...   I could make the change in my two combined templates for people to use... but then if they ever decided to switch templates, things could get ugly...

Each template is different, even in the <head> section.... which is what prevents people form releasing mods that automatically fit all SMF templates...
Сл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."

vavroom

That's a good point.  Hadn't considered that.

I like standards though, which I know isn't the same as "standard"  :P

Oh well. :)

Cheers
Nic
The longer you stare at the screen, the blanker it gets...

Orstio

QuoteThough seems to me that it's something that should be considered and a "standard" way devised for those wanting to integrate their templates/forum "properly"

The problem with that is simply the flexibility of both the Mambo templates and SMF themes.  I am looking at a way to possibly automate this, but there are no guarantees it will work for all Mambo templates or all SMF themes (If I can get it working at all).

vavroom

Cool :)

Of course there are no guarantees.  I've seen hundred of templates for mambo, and y'all are right, there are as many ways to approach it as there are people, so it seems.

Perhaps a "guide", with what elements must be in the head of the template, or at the end of the page, with examples on how to determine the display of it or not.

For instance, Kindred was suggesting in another thread to use something like:

if ($_REQUEST['option'] = 'com_smf') {
(template for SMF showing)
} else {
(template for the rest of the site)
}

Which on the surface should work well enough :)  But somehow, this doesn't seem to work on my test site.  Perhaps because I have SEF enabled, I don't know.

Please note, I'm not trying to make more work for you guys, you're already doing temendous service and work, for which I don't think you're receiving enough thanks (and no, I'm not sucking up ;) ).
Nic
The longer you stare at the screen, the blanker it gets...

Orstio

You can't just turn off the header in SMF, nor in Mambo, however.  There are javascript functions linked in each of them, so to run a wrapped forum, both must be present.

So, it's more a matter of joining the two appropriately, rather than just omitting one.

vavroom

Quote from: Orstio on June 08, 2005, 06:36:13 AM
So, it's more a matter of joining the two appropriately, rather than just omitting one.

Yes, yes, I realise that :)  I'm not wanting to omit one or the other.  I'm wanting to eliminate the double HTML, HEAD, and BODY tags created by loading SMF in wrapped format. 

And I'm not sure how to appropriately join the two, there's the rub...

As I said, it would appear not to be creating a problem for page display.  I could see it being a problem to validate pages, but that is not mission critical :)

Cheers
Nic
The longer you stare at the screen, the blanker it gets...

Orstio

Well, something I did, which I can try to describe:

(Make sure to back up your files before attempting this!)

1)  Go to the wrapped forum, and "View Source".
2)  Copy all the information between the second set of <head> tags.
3)  Paste that into your Mambo template, between the <head> tags.
4)  Add this to the SMF theme, index.template.php, just before the <html> tag:

if (empty($_REQUEST['option'])){

...making sure to close any echo statements, and make new echo statements appropriately. (You obviously can't plop an "if" statement inside an "echo".)

5) Add this just after the <body> tag, same file, to close the "if" condition:

}

6) Repeat steps 4 & 5 for the closing body and html tags (enclosing them in the "if" statement.

Doing this got rid of my duplicate <html>, <head>, and <body> tags.  The side effect is that the entire site now runs off my SMF CSS, which is fine for me.  Others may wish to omit the link that does that, and just run off the Mambo CSS.

vavroom

Nic
The longer you stare at the screen, the blanker it gets...

Advertisement: