Better Title Tags In Ekklesia 360

I’ve been the primary user and manager of our Ekklesia 360 site for a couple of years now. It’s a nice system, especially for large churches because it includes very useful functionality right out of the box.

However, as functional and useful as some of the features are, optimizing your site for search engines and user navigation can be a little daunting. One thing that has been bugging me for a while now is Ekk’s lack of attention for the <title> element.

Because of how the Monk CMS API works, each template (or module) type uses a different API call to spit out content. This means that each page, article, event, or sermon requires a different getContent() statement to find the page’s content.

Here’s a hack-ish solution I came up with to display a more relevant <title> element using PHP to find the template type using the page URI. After the page URI is found with $_SERVER['REQUEST_URI'], we’re using preg_split() to find the first part of the URI, which is the template type. After that’s found, we show Ekklesia which getContent() statement to use and then we get the correct title, no matter where we are in the site.

This should help those (like us) who have been victims of the dreaded “duplicate content” warnings on Google webmaster tools and similar systems.

<title>
<?php
  $hdtitle = getContent("page","find:".$_GET['nav'],"show:__title__","noecho");
  if ($hdtitle == "INDEX"){
    echo "Wheatland Salem Church | Naperville & Oswego, IL.";
    } else if ($hdtitle != "") {
      echo $hdtitle." | "."Wheatland Salem Church";
    } else if ($hdtitle == "") {			
      $uriPath = preg_split("/\//",$_SERVER['REQUEST_URI'],-1);
      $uriKey = $uriPath[1];		
      if ($uriKey == "article") {
        getContent("article","display:detail","find:".$_GET['slug'],"show:__title__ | ");
        echo "Wheatland Salem Church";
      } else if ($uriKey == "sermons") {
        echo "Sermons | Wheatland Salem Church";
      } else if ($uriKey == "events") {
        echo "Events | Wheatland Salem Church";
      } else if ($uriKey == "sermon") {
        getContent("sermon","display:detail","find:".$_GET['slug'],"show:__title__ | ");
        echo "Wheatland Salem Church";
      } else if ($uriKey == "event") {
        getContent("event","display:detail","find:".$_GET['slug'],"show:__title__ | ");
        echo "Wheatland Salem Church";
      }
    } else {
      echo "Wheatland Salem Church";
  }
?>
</title>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">