Making the Large Logo appear on every page

Use this forum to ask questions about how to do things in GuMax skin.
Post Reply
User avatar
argh
Rank 1
Rank 1
Posts: 5
Joined: March 3rd, 2008, 11:03 am

Making the Large Logo appear on every page

Post by argh »

Paul - love the wiki skin. Thanks again.

Is there an easy way to make the image that spans the main page (main_page.jpg) appear in that location on every page?

I am a real newbie, so if you don't mind, speak slowly. ;)
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: Making the Large Logo appear on every page

Post by Paul »

If you want to do this, very easy way is to edit the GuMax.php, and find this section:

Code: Select all

		if($found) { ?>
			<div id="gumax-article-picture">
				<a style="background-image: url(<?php echo $sitelogo ?>);" <?php
					?>href="<?php echo htmlspecialchars( $GLOBALS['wgTitle']->getLocalURL() )?>" <?php
					?>title="<?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?>"></a>
			</div>
		<?php }
update background-image with a image name instead of article name.
:lol:
User avatar
argh
Rank 1
Rank 1
Posts: 5
Joined: March 3rd, 2008, 11:03 am

Re: Making the Large Logo appear on every page

Post by argh »

Here's what I did. I made $found = true in all cases and uncommented the line

Code: Select all

		// $sitelogo = $this->data['stylepath'] . '/' . $this->data['stylename'] . '/images/header/' . 'default.gif'; // default site logo
Then I changed the name of the image in the code to main_page.jpg. That worked, and should replace my default image with any article-specific image.

Code in context follows.

Code: Select all

<?php
        $file_ext_collection = array('.gif', '.png', '.jpg');
        $found = true;
        foreach ($file_ext_collection as $file_ext)
        {
            $filename = $_SERVER['DOCUMENT_ROOT'] . '/' . $this->data['stylepath'] . '/' . $this->data['stylename'] . '/images/header/' . $pagename . $file_ext;
            if (file_exists($filename)) {
                $sitelogo = $this->data['stylepath'] . '/' . $this->data['stylename'] . '/images/header/' . $pagename . $file_ext;
                $found = true;
                break;
            } else {
				 $sitelogo = $this->data['stylepath'] . '/' . $this->data['stylename'] . '/images/header/' . 'main_page.jpg'; // default site logo
			}
Thanks!
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: Making the Large Logo appear on every page

Post by Paul »

No problem. :P
Post Reply