[MOD] Per Page Seo Meta Tags

Cool tips and tricks about Jaws

[MOD] Per Page Seo Meta Tags

Postby hayden » Wed Feb 15, 2012 11:29 am

Firstly i built this on a Jaws 0.8.14 install, so you will have to test it on other versions to see if it works for them too...

Ok, so Jaws has site wide (global) meta tags generally speaking.

For Seo reasons my clients needed different one's for each page.

I just made this simple mod from the skeleton gadget to do this.

If there is a matching rule in overrides.php it will overrides your site meta settings with that of the rule's

Currently supports: title, description and keywords meta tags

It is early development stages, but works.

As such there is no admin, you just enter your settings into the Seo/resources/overrides.php file

To install:

    1 - unrar the attached file and put the contained 'Seo' folder in your 'gadgets' folder
    2 -in your admin install this now available 'Seo' gadget
    3 - configure the Seo/resources/overrides.php settings file with your needed meta
    4 - make the following 2 necessary changes to your /include/Jaws/Layout.php file to allow this gagdet to work its magic
:mrgreen:
Find:
Code: Select all
        if (JAWS_SCRIPT == 'index') {
            $this->PutTitle();
            $this->PutDescription();
            $this->PutMetaKeywords();
            $this->PutMetaLanguages();
        }


Change To:
Code: Select all
        if (JAWS_SCRIPT == 'index') {
            $this->PutTitle();
            $this->PutDescription();
            $this->PutMetaKeywords();
            $this->PutMetaLanguages();
            $this->Seo();//haydent
        }


Find the last }:
Code: Select all
       
        }


Add just before it:
Code: Select all
    /**
     *  Override Standard Meta System With Seo Gadget Settings - haydent
     */
    function Seo()
    {
      $model = $GLOBALS['app']->LoadGadget('Seo', 'Model');
        $override = $model->GetOverride();
      
      if($override){
   
         $this->_Template->ResetVariable('site-title', $override['meta_title'], 'layout');
         $this->_Template->ResetVariable('site-description', $override['meta_description'], 'layout');
         $this->_Template->ResetVariable('site-keywords', $override['meta_keywords'], 'layout');
   
      }
    }


Let me know if you have any troubles.
Attachments
Seo.rar
Seo v0.1 Gadget
(8.63 KiB) Downloaded 529 times
hayden
 
Posts: 96
Joined: Wed Oct 22, 2008 12:17 pm
Location: Sydney, Australia

Re: [MOD] Per Page Seo Meta Tags

Postby mixsms » Wed Feb 15, 2012 8:24 pm

Hi Hayden,

I'm really thankful to you for this awesome mode for SEO purpose, I just was looking for that, notify admin about such changes are necessary but I think they are so busy. However you're the only regular contributor who works superbly.

I'm gonna it be checked and if troubled I'll let you know.

Thanks agian.
Click To See on intelmixx.com
Click Here
mixsms
 
Posts: 6
Joined: Wed Feb 15, 2012 7:39 pm

Re: [MOD] Per Page Seo Meta Tags

Postby hayden » Thu Feb 16, 2012 11:01 pm

mixsms wrote:Hi Hayden,

I'm really thankful to you for this awesome mode for SEO purpose, I just was looking for that, notify admin about such changes are necessary but I think they are so busy. However you're the only regular contributor who works superbly.

I'm gonna it be checked and if troubled I'll let you know.

Thanks agian.


thankyou. didnt think anyone would notice it here.... :P
hayden
 
Posts: 96
Joined: Wed Oct 22, 2008 12:17 pm
Location: Sydney, Australia


Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 1 guest

cron