Skip to content

Problems with JavaScript files references and MVC/SEO friendly applications

JavaScript, unlike CSS, is executed relative to the path of the html page that contains the JavaScript code. This introduces some difficulties in you have a typically MVC application using SEO friendly links. Why? Because JavaScript doesn’t have the concept of a “base” url, or any way to define it. So if you want to reference a url resource in JavaScript, but don’t want to hard code the urls, what can you do?

Print to your <head /> tag in your main page template a JavaScript variable that defines the path to the theme – you can then reference this variable in your JavaScript code using it as a “base”. That lets you keep your JavaScript code nice and modular…

I’ve used this is a few times when coding custom Magento or WordPress themes and it saves a little bit of pain when transferring from the Development to Live server…

<head>
<script> var themePath = 'http://www.mysite.dev/pub/theme/name';</script>
</head>
<script> var swfPath = themePath + '/images/swf/';</script>
Posted in Web Development | Comments Off on Problems with JavaScript files references and MVC/SEO friendly applications

OS X App Store is evil – 1-click purchasing the only option

Snow Leopard 10.6.6 has introduced the App Store to Macs, so you can now buy software as easily as you can on your iPhone, iPod and iPad. However, unlike those stores, Apple seem to have enabled 1click purchasing by default. This is evil.

1-click purchasing means that you aren’t asked for your password for subsequent purchases. Now just imagine the chaos your kids can do if they have access to you Mac. With the average cost of Mac apps being higher than their iOS equivalents, you could find yourself receiving a really unpleasant surprise…

Posted in Apple | Comments Off on OS X App Store is evil – 1-click purchasing the only option

Remote Snow Leopard OS X Sever Support

Just had a trip down memory lane! I got contacted by a colleague in Sussex who was having problems setting up File Sharing on Snow Leopard 10.6 Server. I had some sympathy for him – Apple advertise their server products as being simple to use and configure, and competent Mac users think they should be able to “bluff” through it. I’m here to tell you, you might be in for a nasty surprise…

I remember many years ago when I setup my first OS X Server. My abiding memory is of the hours spent reading the PDFs manuals and trawling the Apple Mailing Lists for answers to seemingly obvious things. Over the years the configuration procedures and Server Admin Tools have become progressively more forgiving and comprehensive, but it can still be quite daunting for a first time user.

After I got the VPN details it was a relatively painless process to backtrack through the misconfiguration, fix the problems in Workgroup Manager and Server Admin and get things up and running. However without prior knowledge it would have taken ages to trawl through the manuals and piece together the relevant process to get things up and running.

If you have a problem with OS X Server and need onsite or remote support, please give us a call on 01380 830224. If you’ve got a VPN or iChat, it doesn’t matter that we’re based in Bath – we’re only a few mouse clicks away from helping you out…

Posted in Apple, Troubleshooting | Tagged , , | Comments Off on Remote Snow Leopard OS X Sever Support

WordPress Training in Bath, Bristol and Wiltshire

With the increasing number of people choosing WordPress as the Content Management System (CMS) that powers their website, here at Sweet-Apple we’re getting more and more enquiries about providing WordPress training.

One on One, group, telephone or remote training

If you’re looking for training, advice or tuition on how to make the most of your WordPress website, we can provide one on one, group, telephone or remote training via Skype. We’re developing more and more WordPress websites, either directly for our customers, or as a freelance web developer acting “covertly” for design agencies in and around Bath and Bristol, and hence have plenty of experience of the multitude of ways people use WordPress.

Learn safely without affecting your “live” website

Typically we’ll  setup a training “sandbox” on our servers so that you can experiment and learn without effecting your own site. We’ll take you through the process of creating Pages, organising your Posts, uploading and linking to images, PDFs, Word files, creating menus. We’ll shown you best practice for Search Engine Optimisation, how to safely update your site, installing and configuring plugins, managing themes. And most importantly we’ll talk about what, why and how you should be blogging  about. And then you can take that knowledge and apply it to your own WordPress website.

If you need any assistance with setting up your WordPress website, training, developing a custom “theme” or look for your site, we would love to help. Please get in touch on 01380 830224 for more details and to discuss your specific requirements in depth.

Posted in Web Development, Wordpress | Tagged , | Comments Off on WordPress Training in Bath, Bristol and Wiltshire

Clean MacBook fans to avoid them breaking…

I’ve had a MacBook Pro and a MacBook in the workshop this week, one which was running incredibly hot and noisily, the other with a fan that was basically knackered. Replacing fans in a MacBook of any flavour is relatively straightforward, and hence won’t break the bank. But just think about the damage you might be causing by having insufficient cooling…

Opening up the MacBook I could immediately see the problem. Thick sticky dirt coated the fan, fan radiator and logic board. If you’re a smoker or work in an environment where there’s fat in the air you will get this problem. The fats and tar stick the fine dust together into clumps and there’s little you can do about it. However try using a paint brush to remove dust from around the ventilation slots under the screen to mimise the build up.  I replaced the fan, cleaned things internally and presto it ran as quiet as a mouse again.

On the MacBook Pro the problem was more interesting – the entire inner surface of the computer was completely coated with a fine layer of dust. Typically you see thick dust localised around the fans, with much less over the logic board. It turns out a “genius” in the Bath AppleStore had advised them to blast the ventilation slot with compressed air. The only problem with this is you’re forcing dust further into the computer, which to me seems rather counterproductive.

A paint brush around the ventilation slots will keep them relatively clean and ensure air flows into and out of the computer with minimal amounts deposited into the computer. If you’re worried that you work in a particularly dusty environment, get someone to whip the top case off and clean it properly. It doesn’t take long or cost much money, and in all honestly will most likely be unnecessary – but please don’t blow the dust back inside!

Posted in MacBook | Tagged , , | Comments Off on Clean MacBook fans to avoid them breaking…