Saturday, 3 August 2013

Care and Nursing Home Android App

Native Android Application

To complement the new mobile and tablet release of our care and nursing home website we have now developed an Android app for your download.


Mobile App Interface


You can download it using Google play by clicking the button below, there is an app package file avaliable from here (apk) or you can use Google play to install by just search for the word Care Home or net.carehomes.carehome.


We will be writing a new article on the development of our mobile device strategy soon, as you may know we have been very busy developing new features to help improve our user experience.

Also we have nearly completed our first draft of an article discussing debugging in PHP with xDebug and profiling scripts with the help of kcachegrind.

Wednesday, 31 July 2013

The Care Homes Directory Releases Mobile Website

Designed for Mobile and Tablets

The Care Homes Directory has now released a new website designed specificity with mobile and tablet devices in mind. It is a simple minimalist design and we hope that our visitors enjoy the new format.

If you visit our desktop site using your mobile or tablet you will be redirected to our new website one thing the mobile site allows you to do is access our navigation panel using a swipe or clicking the home button in the top left corner.
Screen shot of our new mobile home page design.
New Home Page

We have been noticing that our percentage of mobile users has been steadily growing and we feel a new layout and design was in order to help provide the best possible user experience.


Picture of the town listing page on the new mobile website.
Care Homes


As one of the leading care and nursing home websites our new mobile site is one of the first to specifically cater for mobile and tablet devices in our sector and we hope our users prefer the simple layout on smaller screen sizes.


A screen shot of the town page with the sections collapsed
Sections Collapsed
Please do not hesitate to contact us for any information regarding advertising on our new mobile website or getting your providers listed with us.

Sunday, 21 July 2013

jQuery UI Div Content Rotation

Changing Div HTML at Intervals

Recently we released a new look home page for the website and one feature we decided upon was a content rotation div so we could cycle through some blocks of content and display different things at a set interval.

If you have read some of our other articles you will know that we like to use jQuery as a JavaScript framework to provide solutions for some basic UI, Form and other functions.


jQuery UI


Loading jQuery

We like to use the Google CDN for hosting our jQuery libraries but you could use the jQuery CDN or even host your own but we would advise using a CDN as they will normally be more reliable and also better distributed.

As you should know it is better to add any external JavaScript file includes to the <head> section of your HTML document.

On a side note the script tags now have a new attribute async which informs the browser to load it asynchronously this will allow the page to continue loading. See here for more information.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

Adding the above to our HTML file gives us something like below.
<html>
  <head>
    <title>Example Template</title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
  </head>
  <body>
  </body>
</html>

This is a good start and all we need to do now is add the div to the page and write the JavaScript responsible for rotating the div.


Adding the Div

Now we can add the div to the template this will be the container which holds the HTML to be rotated.
<html>
  <head>
    <title>Example Template</title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
  </head>
  <body>

    <div id="rotate_wrapper">
      <h2>This is the original</h2>
      <p>Some example text</p>
    </div>
  </body>
</html>

Now we have a base to work from we can now add the JavaScript which is responseable for the actual content rotation.


JavaScript

Adding the JavaScript is simple and a lot of leg work has been done by the jQuery developers, Add the code block bellow inside the <head> tags. This defines our rotation array the idea is each element in the array has your HTML that you want the div to switch to at predefined intervals.
<script type="text/javascript">
  var rotateArray = new Array(
    '<h2>Example Heading One</h2><p>Short description</p>,
    '<h2>Example Heading Two</h2><p>small block of example</p>',
    '<h2>Example Heading Three</h2><p>another item</p>',
    '<h2>Example Heading Four</h2><p>Some example text</p>',
    '<h2>This is the original</h2><p>Some example text</p>'
  );
</script>

Now we have the content for our rotation div we need to add the code for switching it this code block should be just inside the closing </body> tag.
<script type="text/javascript">
var numItems = rotateArray.length;
var index = 0;
setInterval(function() {
    $("#rotate_wrapper").fadeOut("slow", function() { $(this).html(rotateArray[index]).fadeIn("slow"); });
    index = (index + 1) % numItems;
}, 4000);
-->
</script>

The code above defines the size of our content array and sets an index to zero next we use the setInterval() function to do the actual rotation the second parameter to this function is the millisecond between rotations for our needs 4000 was a good value.

Inside the setInterval() function we use jQuery to fade the div out then it uses the .html method to set the content of the div to the array element defined by index and then it will fade this new content in.

Once the actual transition has been completed we increment the index and divide by the size of the content array and then take the remainder from that as our next array element index.

The Finished Markup

Below is the code block containing the complete markup for our div rotation and it should be simple to modify and customise this to your needs.

We found jQuery to be good for these kind of use cases because as you can see just by writing a few lines of code we take advantage of the power of a framework.

This leads us to using a rapid release schedule and using rolling release to keep up with the pace of change. Our new home page was implemented in a short amount of time and we are now ready to make the next release for it which is just a small clean up and polish.
<html>
  <head>
    <title>Example Template</title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
    <script type="text/javascript">
    <!--
    var rotateArray = new Array(
      '<h2>Example Heading One</h2><p>Short description</p>',
      '<h2>Example Heading Two</h2><p>small block of example</p>',
      '<h2>Example Heading Three</h2><p>another item</p>',
      '<h2>Example Heading Four</h2><p>Some example text</p>',
      '<h2>This is the original</h2><p>Some example text</p>'
    );
    -->
    </script>
  </head>
  <body>
    <div id="rotate_wrapper">
      <h2>This is the original</h2>

      <p>Some example text</p>
    </div>
    <script type="text/javascript">
    <!--
    var numItems = rotateArray.length;
    var index = 0;
    setInterval(function() {
       $("#rotate_wrapper").fadeOut("slow", function() { $(this).html(rotateArray[index]).fadeIn("slow"); });
        index = (index + 1) % numItems;
    }, 4000);
    -->
    </script>
  </body>
</html>

You can see the complete working example script working by following this link I decided to host in on my personal website although I could have hosted it on our Google sites account or jsfiddle but this was easier.


Conclusion

As you can see from this article jQuery and jQuery UI can both make development of user interface a lot simpler and it makes sense to use a framework to do this heavy lifting because we all know its silly to reinvent the wheel.

The newly released home page on our website has been doing well and we are now in the process of adding support for oAuth2 login to our enhanced listings page to allow a more seamless integration of Google wallet payment support and making logins simpler for our users.

After this we will be adding DFP to our website to allow us to sell granular advertising with multiple ad networks. We will also be adding multiple payment methods to make it even easier for our customers to purchase advertising.

Wednesday, 17 July 2013

New Look: More changes

New Look Home Page


The Care Home Directory has released a new look home page which we believe will offer our site visitors a better experience. We think most importantly that it has been simplified and made to look more visually appealing.
Picture of our home page which has eight columns of short content.
New Look Home Page

Our index page now has two columns of four rows allowing us to present all our web sites main content areas simply and we have removed all our text and moved it into a new page.

Both the bottom two cells are rotation cells whose content is changed dynamically every four seconds allowing us to show case some of our enhanced listings.

If you are a care provider or a home owner please do not hesitate to contact us to discuss having your home featured on our new look home page.

We will be writing a future article on how we decided to implement our rotation divs and we still have an article about debugging and profiling PHP scripts to be released.

Thank you

Sunday, 14 July 2013

New Resources and Links Page

Link List


We will be compiling a list of useful resources and links on a new page we have created in the hope they might help someone and it should also be a good as a reference for us.

This list will be updated from time to time to add new links and resources so stay tuned for any updates. If you notice any mistake or additions please contact me.

You can find the page here.