Inluding a header and footer

Use this forum to ask questions about how to do things in GuMax skin.
Post Reply
User avatar
Stargater59
Rank 1
Rank 1
Posts: 5
Joined: November 5th, 2007, 2:17 pm

Inluding a header and footer

Post by Stargater59 »

Hello, I'm wondering how I would go about adding an include to include a header and footer.

In the header I would have my site's links, and banner, etc.. And the footer would contain a few links, and close all the DIV tags opened in the header. I do the same thing with SMF, and it works perfectly, however, when I try to add an include to the very top of the skins template file, it doesn't work. It's as if though nothing was added at all.

Is there a way to do this? I'm using GuMax 3.2.1, as the design will work better within my site's template.

Thanks for any help.
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: Inluding a header and footer

Post by Paul »

I believe you could do that by editing GuMax.php. Make sure your header and footer files are in the right place in order to make it work properly.
User avatar
Stargater59
Rank 1
Rank 1
Posts: 5
Joined: November 5th, 2007, 2:17 pm

Re: Inluding a header and footer

Post by Stargater59 »

Where would be the right place? I've tried putting the include in this spot:

Code: Select all

<body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
<?php if($this->data['body_onload'    ]) { ?>onload="<?php     $this->text('body_onload')     ?>"<?php } ?>
 class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> <?php $this->text('pageclass') ?>">

<?php include('header.php');?>

    <!-- =================== gumax-page =================== -->
    <div id="gumax-page">
    <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>

    <!-- Header -->
    <div id="gumax-header">
        <a name="top" id="contentTop"></a>

        <!-- Site Logo -->
        <div id="gumax-p-logo">
But it doesn't work. The header.php file is in the skins folder. Should it be somewhere else?
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: Inluding a header and footer

Post by Paul »

It should work, the file should be in the folder where GuMax.php is in.
User avatar
Stargater59
Rank 1
Rank 1
Posts: 5
Joined: November 5th, 2007, 2:17 pm

Re: Inluding a header and footer

Post by Stargater59 »

Well, that's how I have it. However I noticed when I looked at the page's source, it looked like this:

Code: Select all

<body  class="mediawiki ns-0 ltr page-Main_Page">

    <!-- =================== gumax-page =================== -->
    <div id="gumax-page">
    
    <!-- Header -->
    <div id="gumax-header">
        <a name="top" id="contentTop"></a>
include('header.php');
        <!-- Site Logo -->
        <div id="gumax-p-logo">

            <a style="background-image: url(/wiki/skins/common/images/wiki.png);" href="/wiki/index.php/Main_Page" title="Main Page"></a>
        </div>
        <!-- end of Site Logo -->

        <!-- Login -->
        <div id="gumax-p-login">
            <ul>
Why would it be doing that? I'm not entirely sure how it's doing that when I have the include above
<!-- =================== gumax-page =================== -->

But when viewing the page's source, it shows up several lines below that.. And why isn't the PHP getting executed?
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: Inluding a header and footer

Post by Paul »

You need put PHP tag for your include, try this:

Code: Select all

<?php include('header.php'); ?>
Let me know if it works.
User avatar
Stargater59
Rank 1
Rank 1
Posts: 5
Joined: November 5th, 2007, 2:17 pm

Re: Inluding a header and footer

Post by Stargater59 »

Yes, that's how it is in the actual code. But when I view it in Firefox's 'View page Source' it comes out like that.
User avatar
Stargater59
Rank 1
Rank 1
Posts: 5
Joined: November 5th, 2007, 2:17 pm

Re: Inluding a header and footer

Post by Stargater59 »

Ok, I have resolved my issue.

To clear up my last post, what I meant was, in GuMax.php I had

Code: Select all

<?php include('header.php');?>
But when I viewed the page's source via 'View Page Source' in Firefox, what I saw was

Code: Select all

include('header.php');
Which didn't make any sense. So, I just went to the wiki, to see if I could figure anything out, and my header was there. I remember my cache being cleared. So I added the footer, and my CSS. But nothing changed. That is until I cleared my cache. And now everything is there.

Short answer: Clear cache. :D

So, thank you for your help. And I really like your themes. Keep it up!
Post Reply