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.
Inluding a header and footer
- Stargater59
- Rank 1
- Posts: 5
- Joined: November 5th, 2007, 2:17 pm
Re: Inluding a header and footer
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.
- Stargater59
- Rank 1
- Posts: 5
- Joined: November 5th, 2007, 2:17 pm
Re: Inluding a header and footer
Where would be the right place? I've tried putting the include in this spot:
But it doesn't work. The header.php file is in the skins folder. Should it be somewhere else?
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">
Re: Inluding a header and footer
It should work, the file should be in the folder where GuMax.php is in.
- Stargater59
- Rank 1
- Posts: 5
- Joined: November 5th, 2007, 2:17 pm
Re: Inluding a header and footer
Well, that's how I have it. However I noticed when I looked at the page's source, it looked like this:
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?
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>
<!-- =================== gumax-page =================== -->
But when viewing the page's source, it shows up several lines below that.. And why isn't the PHP getting executed?
Re: Inluding a header and footer
You need put PHP tag for your include, try this:
Let me know if it works.
Code: Select all
<?php include('header.php'); ?>
- Stargater59
- Rank 1
- Posts: 5
- Joined: November 5th, 2007, 2:17 pm
Re: Inluding a header and footer
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.
- Stargater59
- Rank 1
- Posts: 5
- Joined: November 5th, 2007, 2:17 pm
Re: Inluding a header and footer
Ok, I have resolved my issue.
To clear up my last post, what I meant was, in GuMax.php I had
But when I viewed the page's source via 'View Page Source' in Firefox, what I saw was
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.
So, thank you for your help. And I really like your themes. Keep it up!
To clear up my last post, what I meant was, in GuMax.php I had
Code: Select all
<?php include('header.php');?>
Code: Select all
include('header.php');
Short answer: Clear cache.
So, thank you for your help. And I really like your themes. Keep it up!