Concrete5 Tips and Hints

Concrete5 already has the majority of essentials spot on, but to improve your version of Concrete5 further, follow these tips!

  1. Force Concrete5 to Include Canonical Tags

Concrete5 only includes a CCM_BASE_URL, but no canonical, therefore to do alter this, you need to go into the concrete5 directory and find theheader_required.php file (public_html / concrete5 / elements / header_required.php). Insert the following php snippet immediately after the declarations of the BASE_URL, CCM_REL etc as so:

$url=loader::helper(‘navigation’);
$canonical=$url->getCollectionURL($c);

Including the tags as shown below:

b

  1. Redirect WWW’s to non WWW’s

Having both WWW and non WWW URL’s can lead to duplicate content and thus force Google to put your website down in the rankings. The majority of people agree that you should redirect www pages to non www pages (or vice versa). To do this, simply insert the following into your .htaccess file, which may be hidden depending on which FTP Client you are using.

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.yourwebsite.com [NC]
RewriteRule ^(.*)$ http://yourwebsite.com/$1 [L,R=301]

  1. Change the Ordering of the Automatic Page Title

Concrete5 orders the title in a way that may not being helping your SEO campaign as the site name appears first and then the page name. To change this, navigate to Concrete/Config/base.php and edit the class where the the below segment exists:

if (!defined(“PAGE_TITLE_FORMAT”)) {
define(‘PAGE_TITLE_FORMAT’, ‘%1$s :: %2$s’);
}

and switch the %1$s and %2$s around.

  1. Achieve Full Control of Contact Forms

Although Concrete5 supplies an add on for contact forms, there is little control that you can have over it with regards to styling. This was a major issue when designing responsive websites as the contact forms were using fixed widths. There was a way around this by modifying the concrete5 files and changing the fixed width text boxes into percentages, such as the comment section below. However, I still wanted full control, therefore using Jordan Lev’s concrete5 custom contact form architecture on github, full control was made possible. Below is an example of the custom contact form on theVanda Coatings website.

a

As you can see, with full control you are able to apply styles to any part of the contact form using classes within your stylesheet. Even if you are not an advanced PHP programmer, the customization is very basic, unless of course you wish to go further. The two files that you will need to access are(packages / custom_contact_form / models / custom_contact_form.php) which contains all of the fields you want within your contact form and any other settings. You can create as many contact forms as you wish, but remember to keep the names unique, as shown below: