DESIGNED DEVELOPED DELIVERED

Mob: 07760 392284edward@ee-web.co.uk

ee-web thinks... a bit

Go on, make my day ... leave a comment

Unhooking Funtions in wordpress

August 28th, 2014 by Edward

I had a design for wordpress that had no footer – except two coloured, full-width bars. I could have just copied footer.php in the childtheme and commented out the thematic_footer() call around line 30.

But, that’s no good really – well it works, but I wanted to do by removing (unhooking) actions from the do call. So, searching through the whole thematic template I found there – (on different lines of course)

do_action('thematic_footer');
add_action('thematic_footer', 'thematic_subsidiaries', 10);
add_action('thematic_footer', 'thematic_siteinfoopen', 20);
add_action('thematic_footer', 'thematic_siteinfo', 30);
add_action('thematic_footer', 'thematic_siteinfoclose', 40);

So, best thing to do then is to unhook these functions that are added to the thematic_footer and add my own new on.

So, off to functions.php within my child template to add this:

		//remove all the inbuilt footer stuff.
		remove_action('thematic_footer', 'thematic_subsidiaries', 10);
		remove_action('thematic_footer', 'thematic_siteinfoopen', 20);
		remove_action('thematic_footer', 'thematic_siteinfo', 30);
		remove_action('thematic_footer', 'thematic_siteinfoclose', 40);

would seem the obvious thing to do – but ah ah! It wont work – got to make sure things happen at the right time. So we need to add the removes to the init function. So I created a function called ‘fobhs_add_and_remove’, added it to init and then declared the function – and now it works!

add_action( 'init' , 'fobhs_add_and_remove' , 15 );

function fobhs_add_and_remove() {
        add_action('thematic_header', 'fobhs_add_header',2);
		//remove all the inbuilt footer stuff.
		remove_action('thematic_footer', 'thematic_subsidiaries', 10);
		remove_action('thematic_footer', 'thematic_siteinfoopen', 20);
		remove_action('thematic_footer', 'thematic_siteinfo', 30);
		remove_action('thematic_footer', 'thematic_siteinfoclose', 40);
		// add the simple footer supplied - not shown below
		add_action('thematic_footer','fobhs_footer', 50);
}

Now it works! Next step to create the function ‘fobhs_footer’ and to add in the what’s required to create the bars.

categories
tag

Difference between alt and title tags for an image

July 16th, 2014 by Edward

I keep forgetting this, and about once a month end up looking up – so here’s a post, primarily for my memory!

ALT (or Alternative Text) – describes the image in the page, displays if img fails to load (but not in all browsers???). It should be brief and descriptive. For some reason Joomla calls this the image description (which I suppose it is really!) This tag was introduced for visually impaired users and without it you will be penalized in SEO terms.

TITLE – describes the image, a bit like alt- providing ‘additional’ info about the image in a pop up animation on hover (but not in all browsers). Seems its used primarily when an image links to other content, describing where the link is going, but is optional for img. If missed out some browsers display the alt on hover.

Example:
If you are doing a page about Lyme Regis and have Lyme Regis in the title and a cool picture of the cobb and sea you might just do this
Lymne Regis but it wouldn’t be great because it doesn’t’ tell the ‘visually impaired user’ anything. Much better to do View of the Cobb and sea at Lyme regis

Leave a space at the end of the alt description “xxx xxx ” – good for screen readers.

categories
tag

Using the snippet/template function in tinymce

May 10th, 2014 by Edward

In Tinymce extended there is a cool feature that enables you to press a button and insert a pile of code.

As yet I haven’t been able to find how to do this without a core override… but maybe that’s not such a big deal —
Each of the additional snippets is a separate html file that lives in

media/editors/tinymce/templates

It comes set up with a couple of simple examples – layout1.html and snippet1.html.
I just created a new one – quickbio.html in this case which had this piece of code in that was going to be used over and over:

Dr Bob
Springfield University

I am outside the div

Now you have to tell tinymce about the wxistance of this new file – so it needs registering:

This is done in plugins/editors/tinymce/tinymce.php – I’d take a backup of this just in case…

Around line 459 find:

$templates = "templates: [
{title: 'Layout', description: 'HTMLLayout', url:'" . JUri::root() . "media/editors/tinymce/templates/layout1.html'},
{title: 'Simple snippet', description: 'Simple HTML snippet', url:'" . JUri::root() . "media/editors/tinymce/templates/snippet1.html'}
],";
}

This registers the two existing little templates. So its pretty straight forward to add your new one

{title: 'Simple bio', description: 'Use for a photo, with small piece of text under', url:'" . JUri::root() . "media/editors/tinymce/templates/quickbio.html'}

in my case, you just need to be careful with your commas – last one doesn’t need one.

So the final code looks thusly:

$templates = "templates: [
{title: 'Layout', description: 'HTMLLayout', url:'" . JUri::root() . "media/editors/tinymce/templates/layout1.html'},
{title: 'Simple snippet', description: 'Simple HTML snippet', url:'" . JUri::root() . "media/editors/tinymce/templates/snippet1.html'},
{title: 'Simple bio', description: 'Use for a photo, with small piece of text under', url:'" . JUri::root() . "media/editors/tinymce/templates/quickbio.html'}				
					
],";
}

I found that in order to make this appear as an option for the editor in the joomla backend I had to clear the cache – a simple close and open of the article/module wasn’t enough.

So clear that cache, and bob’s once again the proverbial uncle. Snippets of code at the press of the ‘template’ button.

categories
tag

Add border in bootstrap 2 – ‘the learning how to do it’ way

May 6th, 2014 by Edward

 

Its bootstrap 2 for joomla at the moment.

Bootstraps lovely 12 column grid – goes to the edges – which is fine if your inner content doesn’t need a boarder to the wrapper image/colour like this:
shows border that we want to create

It took me a LOT of posting and experimenting to be able to create this within the bootstrap grid

Firstly you have to add an additional wrapper around. In the above this is 24px left and right. You need number that totals a multiple of 12 to make the maths work due to the 12 columns.

If you just add this padding then a 2+8+2 wont fit- obviously if we have added padding, we have reduced the overall space available so the grids need to be narrower – but how much?

You then dig around in the bootstrap-responsive.css file to find the widths of the various spans. For example above 1200px width span8=770px and span2=170px.

So, looking at the span8 first – it was 770px. It represents 8/12 of the total width which we have reduced by 24+24 or 48. So we need to reduce the width of the span8 b7 48*8/12 = 32px. So in your css (not bootstrap-responsive.css), withing the appropriate media query add something like .extraPadding .span 8 {width:738px;}

For span2 the sun becomes 48*2/12 = 8px, so its new width becomes 162px;

Since you wisely chose a padding that was a multiple of 12 this will work out for all the grids – eg span7 reduces by 28px.

You then have to go through all the grids wyou want to use, in all the css.

Now this works, but it is a pain. I suspect it would be better to use the generator feature with bootstrap that I guess would sort this all out for you (although I don’t know, because I am wanting to learn how it works rather than have it all on a plate for me!)

It also needs to be pointed out that I have done this for the non-fluid responsive grid, but I would guess the same would work though you’d need to use percentages rather than widths.

categories
tag

Strict errors in Joomla 1.5 and no access to php.ini

May 6th, 2014 by Edward

Recently my host updated their php. This is good of course. However, I started seeing all, on some sites, a pile of  strict errors like this.

strict Standards: Non-static method JLoader::import() should not be called statically in …

It has taken hours to sort this out, and as ever with ‘debugging. its a one line fix. The newer php is getting cross because it has a higher (and therefore more secure) requirement on how well the php is written. Old code didn’t have to live up to this!

Anyway, like many people out there I have some reseller hosting which  means I can’t access php.ini I tried a whole pile of alterations in both the config and the .htaccess and got some angry responses in stackexchange.com telling me to dump clients!!!

Eventually I put this into the both the main index.php and the one within the administration folder.

After

define( ‘_JEXEC’, 1 );

add

error_reporting( E_ERROR | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING );

Imagine my unconstrained joy at seeing a normal login screen again!

categories
tag

Multiple domains pointing at one site – good or bad for seo?

April 9th, 2014 by Edward

From time to time clients ask me if its a good idea to buy up a pile of domains and point them all at the same website. What effect, they want to know, will this have on their seo. Since this question comes up regularly, but not often, I keep forgetting the answer – so here’s a blog post.

Having researched the issue (again) it seems that there are different answers to the question:

Have the domains ever pointed anywhere else? If they have, there can be a ‘carry over’ meaning that if they linked to a badly rated or even a site with a bad reputation (maybe badly built) the effect can be negative. The reverse can also be true – for a time. If the domains have never pointed anywhere else then there will be no effect.

Make sure the secondary domains redirected to the primary url. Imagine you have www,greatsocks.co.uk as you main domain and buy up www.fabsocks.co.uk and www.awesomesocks.co.uk If you then just point these secondary domains at the same site google (other search engines are available) will see duplicate content. IE www.greatsocks.co.uk/about and www.fabsocks.co.uk/about will be identical, but under different domains. You are very likely to be penalised for this – google will allocate a “preferred or canonical” domain, which oculd be different for each page – this potentially leads to your site being penalised for devalued internal linking. This is where the 301 redirect comes in. When your visitor types in www.fabsocks.co.uk they are re-directed to www.greatsocks.co.uk - so google et al do not see duplicate content. In technical terms – user a 301 redirect.

Don’t dilute external links.Another problem is that you dilute your external links. Ideally links pointing to your site will all point to the main domain. However, if you run a pile of different domains for the same content you can’t control so easily where the backlinks point to. This will then dilute the effectiveness of the links – you could have 2 to each of the three sock examples whereas you could have 6 back to the main one!

It can help when you have a difficult to spell url – or a business name with a hypen in for example

It can be useful to stop the competition getting the domain

So it looks like for most cases the benefits of  having all the different domains are minimal. If you do, make sure they all point to the one, main domain. Make sure all you links to your site point to the main domain.

 

There are many sources but I used these for this short post:

http://moz.com/community/q/is-pointing-multiple-domains-to-a-single-website-beneficial-for-seo-or-not

http://www.hostway.com/web-resources/search-engine-optimization/can-i-use-more-than-one-domain-with-my-web-site-for-seo/

 

categories
tag

php update and joomla 1.5 – solving a couple of errors

March 28th, 2014 by Edward

Many of my clients are still running joomla 1.5 . Recently the hosts that I use upgraded their php to 5.4. This is good news… but has caused some problems with the sites.

Firstly here’s what happens on the front end:
loads of lines of nasty php error codes

Lots and lots of nasty strtotime() errors. Older version so php weren’t so strict about setting the time zone .

Put this in the top line of the configuration.php file – get rid of all the front end

date_default_timezone_set(‘Europe/London’);

… and bob’s your uncle

Secondly I found an error in the back end, but only very occasionally – for example on the list of articles page.

Warning: Creating default object from empty value in … administrator/components/com_content/controller.php on line 97

This time php doesn’t want to use an empty value so just add $section = new stdclass; before $section->title = ‘All Articles’; on line 96 thus:

$section = new stdclass; //edward addition
$section->title = ‘All Articles’;
$section->id = 0;

And again, bob’s your uncle.

categories
tag

Ten reasons why ee-web can help!

February 26th, 2014 by Edward

 

You’re looking for a web professional to help you develop your web presence?

There are lots and lots ot choose from out there. So…

why pick ee-web design and development?

  1. I love my work
  2. I make bespoke solutions
  3. I know as much techie talk as you want to hear
  4. Been making websites for 14 years
  5. Don’t have an expensive London office
  6. Pile of happy customers who keep coming back
  7. Wont try and sell  you more than you need
  8. Am here for the long haul
  9. Have a network of professionals to bring in
  10. Enjoy problem solving

And now the detail:

read more Read more…

categories
tag

Voluntary Sector Training – a re-build and a re-fresh

February 11th, 2014 by Edward

 

Since November 2013 (approx!) I have been involved with a really enjoyable project based in Great Dunmow, Essex. Voluntary Sector Training (VST from now) had an existing site which was based around an “Off the shelf template” and an old version of joomla. VST offer training services for the voluntary sector, and while the old site did enable them to take bookings, it was quite old, had a few layout problems and wasn’t responsive.

Read what VST thought about ee-web

read more Read more…

categories
tag

Long bits of text – how to “Soft break” them

February 4th, 2014 by Edward

The more that responsive websites take off, and just about every job I do now is responsive, the more I came up against the same, silly little problem.

Namely – how do you avoid long email addresses sticking out of their containers?

Like this – you can see how the long string at the bottom has pushed the table outside of its container.

In the pre-responsive days you used to be able to get around this by careful use of a
tag or font-size. But as virtaully all my work is responsive now the need to sort this problem has become more pressing.

There are several complex ways of doing the job, with js and/or regular expressions for example. One way that is talked about is simply to insert the tab <wbr> which stands for “word break opportunity” and therefore lets the browser insert a break, if its needed. So you’d write something like hellofromavery<wbr>veryverylongstring

However, this doesn’t seem to work across the browsers, or at least not for me. Apparently the tab has been adopted by hhtml5, but IE hasn’t got there yet…

So then I tried inserting &#8203; into the string thus:

hellofromavery&#8203;verylongstring.

This was much more successful and seemed to work across the board – and best of all, when I stuck it into the middle of an email address, so it was on two lines, and clicked it the email still worked. FAB

So job done, at least in this case!

categories
tag