Jump to content

SEO for WHMCS Enhancement


growe

Recommended Posts

Re last paragraph, yes thats right, AS LONG as you have renamed your templates (and obviously set the name of your tpl dir as the default in setup). Otherwise the upgrade will overwrite all your tpls and and you'll lose all your customisations.

 

Upgrades effectively overwrite the php files and upgrade the db, but I want to protect my customisations

 

I now do my upgrade this way. i overwrite all the php files, but on invoices, lang & tpl files, i compare the current standard version to the new version, and take the "difference" and insert that into each my templates. That way, all my previous hacks & customisations remain. Almost all my pages are error free (not the case with an out-of-the-box WHMCS install) which is a consideration for SEO.

 

Upgrades take about 10 minutes, plus about an hour to hack about 20 templates.

 

re your second-to-last post, i think you were on the money with setting your default variable.

In custom pages, that could be whatever you define.

In pages like DL, you could then with your seo.inc.php, add to the variable, or replace the variable depending on its use.

 

Why don't we start actually nutting out some alternatives for each of the variables?

 

let me test some variables & I'll get back to you

Link to comment
Share on other sites

  • 11 months later...

So I'm a bit of a latecomer to this thread, but I came up with some code for the seo.php solution.

 

In header.tpl I added the following line to the top:

 

{include_php file="templates/$template/seo.php"}

 

Then I added/replaced the following in header.tpl where needed:

 

{if $meta_desc != ''}
<meta name="description" content="{$meta_desc|strip_tags|truncate:200}" />
{/if}
<title>{if $browsertitle}{$browsertitle}{else}{$companyname} - {$pagetitle}{/if}{if $pagesubtitle} - {$pagesubtitle}{/if}</title>

 

Then I added the additional seo.php file:

 

<?php
if (!isset($this->_tpl_vars['meta_desc'])) {
 switch ($_SERVER['SCRIPT_NAME']) {
// Download Page
   case '/billing/downloads.php':
     $meta_desc = $this->_tpl_vars['LANG']['seodownloads'];
     break;
// Announcments
   case '/billing/announcements.php':
     if (isset($this->_tpl_vars['title'])) {
       $pagesubtitle = $this->_tpl_vars['title'];
       $meta_desc = $this->_tpl_vars['text'];
     }
     else $meta_desc = $this->_tpl_vars['LANG']['seoannouncments'];
     break;
// Knowledgebase
   case '/billing/knowledgebase.php':
     if($this->_tpl_vars['kbarticle']['text']) {
       $pagesubtitle = $this->_tpl_vars['kbarticle']['title'];
       $meta_desc = $this->_tpl_vars['kbarticle']['text'];
     }
     else $meta_desc = $this->_tpl_vars['LANG']['seokb'];
     break;
// Support Pages
   case '/billing/submitticket.php':
   case '/billing/supporttickets.php':
     $meta_desc = $this->_tpl_vars['LANG']['seosupport'];
     break;
// Domain Registration
   case '/billing/domainchecker.php':
     $meta_desc = $this->_tpl_vars['LANG']['seodomains'];
     break;
// Cart
   case '/billing/cart.php':
     $meta_desc = $this->_tpl_vars['LANG']['seoorder'];
     break;
// Client Area
   case '/billing/clientarea.php':
     $meta_desc = $this->_tpl_vars['LANG']['seologin'];
     break;
 }
 if ($meta_desc) $this->assign('meta_desc', $meta_desc);
 if ($pagesubtitle) $this->assign('pagesubtitle', $pagesubtitle);
}
?>

 

Basically what the seo.php file does it check the URL of the current page, and then specify the meta data as needed. I added the text for each one to a new line in the language file. In the same block I was also able to set a custom title (for KB and Announcements) by using either the $browsertitle or $pagesubtitle smarty tags I call in header.tpl.

 

Technically this could all be done in smarty syntax as well, as all the necessary data already exists in a smarty variable ($this->_tpl_vars is the PHP array they're stored in). I found doing it in PHP a little more manageable however, as it avoided using several nested {if} statements. I also prefer to use PHP for logic and Smarty for display, and with the .php files being encoded, this is the best I can do in regards to extraction of logic from display. Ideally this could just be placed in the individual .php files like so (assuming it's a custom page or not encoded):

 

$smartyvalues["meta_desc"] = $value;

 

I hope this helps everyone out.

Link to comment
Share on other sites

  • 5 months later...

It would be even nicer if whmcs would have thought the cart through to ACTUALLY work like a cart. How many carts I know that actually have a single page per product??? Lots! Meta information input is available on that product edit page and fed from the database and even aggregated to xml/rss 2.0 files.

 

If whmcs carts are even to gain organic search ranking, whmcs is going to have to rethink the entire stock template / smarty system. It's taken a few years now and still nothing has been changed in this regard. We will probably research for other billing software packages that DO consider how the pages are being ranked.

Link to comment
Share on other sites

Inetbiz check the news section, they have an ajax based cart for the next version...coming soon.

 

About the SEO issues...well...first thing i like to see is the correction with multiple language SEO....just try to create a KB article in English, then create the same in another language. The url will be different but if you load any of them, both are showing the default language article...completely anti-SEO...which means only the articles in the default language will be index by the SE. If someone have any tip or trick for this i would like hear it.

Link to comment
Share on other sites

If they are going to choose AJAX to manage the cart, we're moving elsewhere. Ajax relies upon the client installation of java. As far as SEO, they should bring on board an SEO person for input on design/development flow and being multi-lingual and ensure the cart code meets the needs of the disabled and screen readers as well as html specifications for href lang handling.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated