By Plimun Web Design

Saturday, February 4, 2012

Joomla .html Extensions + Sitemap.xml

The Problem

You have a Joomla site with search-engine friendly (SEF) page names enabled, and you've enabled .html extensions. So your pages look something like:
http://www.my-domain.com/home.html
To top it off, you'd like to use an extension like XMap by Guillermo Vargas to automatically generate your Sitemap. So far, so good. Here's the rub: you can't figure out how to make the link to your sitemap look like:
http://www.my-domain.com/Sitemap.xml
Out of the box, XMap's path to the sitemap looks something like:
http://www.my-domain.com/index.php?option=com_xmap&view=xml&tmpl=component&id=1

The Solution - Part 1

There are a couple of things you have to do to make this happen. First, you have to edit your .htaccess file. Find the line in your .htaccess file that looks like this:
## Begin - Joomla! core SEF Section.
and add these few lines of new code just above it so that it now looks like this:

## Begin - XMap rewrite

RewriteCond %{REQUEST_URI} ^/sitemap.xml [NC]

RewriteRule .* /index.php?option=com_xmap&view=xml&tmpl=component&id=1 [L]

## End - XMap rewrite



## Begin - Joomla! core SEF Section.

Note - depending on your version of XMap, the query string (the part that follows "index.php?") might be different. To find the right path, log into Joomla! as the Administrator and find the XMap component and find your sitemap. The "XML Sitemap" link has the right query string.

At this point, you should now be able to get to your sitemap by browsing to:
http://www.my-domain.com/Sitemap.xml.html
That's already much better, and if you don't mind the .html after the .xml, you can stop here.

The Solution = Part 2

This next step is a hack to the Joomla router. It's too bad that there isn't another way around this because if Joomla updates the router, your change will be lost. Unfortunately I haven't been able to find any other way around this.

Edit the ./includes/router.php file. Find the line that looks like this - in Joomla 1.7.5, it's on line 66 of the file:
if ($app->getCfg('sef_suffix') && !(substr($path, -9) == 'index.php' || substr($path, -1) == '/')) {

And change it to look like this:
if (!stripos($path,'sitemap.xml') && $app->getCfg('sef_suffix') && !(substr($path, -9) == 'index.php' || substr($path, -1) == '/')) {

Now you should be able to browse to this!
http://www.my-domain.com/Sitemap.xml.html
You can see an example of this on the em2 website. Notice that normal pages have the familiar .html extension, but the sitemap has the .xml extension.

Saturday, January 28, 2012

The Microsoft People's Operating System ("POS")

Since the Microsoft Vista Operating System has gained such a bad reputation among the technically savvy, I'm suggesting Microsoft rename it to the "People's Operating System" (or, "POS") so that the rest of us regular folk don't judge it unfairly just because the elitists who understand technology say it's bad.

Unlike other Operating Systms like the Linux OS, you don't have to do install the Microsoft POS - all you have to do is buy a new PC or laptop and the POS comes pre-installed. It's not free like Linux OS though - you pay for it as part of the cost of the computer.  That's a big advantage though for the majority of users who are happy to have Microsoft's POS.

There are a few special features of the Microsoft POS that you should be aware of:
  • It tends to crash more often than other OS's, and you can't always close your software applications (even if you're a competent Windows administrator - Microsoft's POS doesn't always allow you to kill locked processes). That's a handy feature that helps us recognize and deal with our control issues.
  • It frequently loses wireless connectivity, then the wireless tools lock up.  The only option is to close all of the work you might be in the middle of, and reboot.  Sometimes you have to reboot more than once.  That's OK though.  That forces us to take time out of our busy schedule to chill while we wait for the POS to boot - sometimes more than once.
  • You have to buy commercial anti-virus software and a good firewall if you want to secure the Microsoft POS.  If you're running Microsoft's POS on your computer without these third-party add-ons, odds are you are infected with several viruses.  That's Microsoft's way of giving back to the community - spending money on 3rd party software that wasn't included in the POS helps stimulate our economy.
The Microsoft POS really is quite an impressive Piece Of Software.  It's bound to remain a favorite of computer users for years to come.

Sunday, December 11, 2011

HOW TO: Joomla 1.7 Multi-lingual Sites

Being new to Joomla, I was feeling quite overwhelmed when my boss asked me to configure the built-in language support for a Joomla 1.7 website. Joomfish makes short work of this sort of thing, but as of this writing, the latest version of Joomfish only works with Joomola 1.5. Joomla 1.7 is still pretty new and not many people are using it for commercial websites yet, let alone for multi-lingual websites. So I did what we all do, I headed straight for Google! Imagine my dismay when the only results from Google were posts from other people just like me - asking questions and looking for answers. Nobody, including the fine folks at Open Source Matters, had anything remotely like an idiot's guide that was designed to help a newbie through the process!

Undaunted, I managed to find a few tutorials which I tried time and time again to follow - but they might as well have been in a foreign language! I enlisted my fellow co-worker and resident tech guru, Rocky Cutri. Even he was forced to admit defeat. But I'm Scottish and I don't know the meaning of the word, can't. In the Scottish colloquial, we have a word for that never say die attitude - we call it thrawn. So Rocky and I uninstalled 1.7 AGAIN and, this time without following the tutorials, we finally got it!!

Step by Step Instructions

Here is the step-by-step process I followed, complete with screenshots and big delicious red arrows for those of you who like me, want it nice and easy!

Note: for the purposes of this tutorial, I am using Spanish as my alternative language. But the steps are the same for any language.
  1. Install the latest joomla version (which is version 1.7.2 as of this writing)
  2. Go to plug ins and find the language filter plugin and publish it.
    enable the language-filter plugin
  3. Install a language pack for your alternative language. Make sure the language pack is 1.7 compliant! Many language packs are not.
    1. Log into the Joomla Administrator's control panel
    2. From the top menu, select Extensions -> Extension Manager
    3. In the section that says Upload Package File, supply the URL to the language pack - then click Upload & Install
  4. Go to the Language Manager which you will find in the Joomla! Extensions menu dropdown. and under content, create a new Installed Language for the language you're adding. Take care to follow the conventions for naming languages. Using the Spanish language for example, enter:
    Title:
    "Spanish (Mexico)"
    Title Native:
    "Español (Mexico)"
    URL Language Code:
    "es"
    Image Prefix:
    "es"
    Language Tag:
    "es-MX"
    create your languages
  5. Create two new menus (one for each language): call one Main English and give it a menu type of mainmenu-en. Call the other one Main Spanish and give it a menu type of mainmenu-sp. Then go to the Module Manager and unpublish the module that corresponds to the Main menu.
    create menus for each language
  6. Create a Menu Module for each new language menu. Put the new modules in the same template position as your original menu.
    create modules for each new language menu
  7. Create three articles: one with the language set to ALL, one to English, and one to Spanish. We'll use these shortly when we create out menu items.
    create articles for each language
  8. For each of the 3 menus, create a Home page menu item and link it to single article. This causes a flag (like the Spanish or U.S. flag) to appear rather than the usual star icon.
    create menu items for each language
  9. When editing your menu items, you'll find that there is a new options heading on the right-hand side of the Menu Manager called Menu Item Associations. It's located just under the "Metadata Options". The Menu Item Associations shows a dropdown box for every language menu, except the one you are currently editing. For example, if you are editing a Spanish menu item, then you'll see a dropdown box for your English menu. The purpose of the dropdown is to associate the current menu items with the other languages on your site. For example, you can associate the Spanish Home menu item with the English Home menu item.
    associate Spanish menu items with English menu items
    associate English menu items with Spanish menu items
  10. Create a language-switcher module. In the Basic Options, choose "no" for "Use Dropdowns" if you want to show the language flags.
    add a language-switcher module
  11. Enjoy your new language enabled Joomla! version 1.7 website!

Please don't hesitate to contact me if you need any further explanations:

Michelle Johnston

Sunday, October 16, 2011

There's a reason Blackberry (RIM) is losing marketshare...

There's a good reason that Blackberry (Research in Motion) is losing market share.  A few years back, Blackberry was the business phone of choice.  It had push email, a good contacts organizer, a good calendar, a really nice keyboard, and the hardware was rock solid.  Today's smartphones don't depend on built-in business functionality.  The App Stores fulfill that need.  Users can choose from thousands of apps to perform nearly any task imaginable.

The thousands of apps you find in your favorite App Store are built by programmers. The Android and iPhone platforms attract good programmers.  Android does this through the availability of high-quality, open source (free) programming tools that integrate seamlessly into the newest versions of the most popular Java development environments, like Eclipse and NetBeans.  iPhone attracts Apple  (IOS) programmers because Apple developers are loyal to Apple and iPhone is the only mobile platform for Apple.

There is nothing attractive about Blackberry app programming.  The Blackberry technical support website is virtually devoid of any assistance for programmers.  Useful documentation is difficult to find - and not all that useful after all, once you finally find it.  The Blackberry programming tools are built for an ancient version of Eclipse - the tools might work in current Eclipse versions and in NetBeans, but if they do, there's no indication of that on the programmers section of Blackberry's website.  The Blackberry device emulators (a "virtual Blackberry phone" that programmers can run on their computers to test their mobile apps as they program, before putting them on a real phone) are the slowest of any I've seen.  This can easily double or even triple the time it takes to develop apps for Blackberry, which drives up the cost to develop an app.

As a result, the iPhone and Android App Stores have the best selection of free and low-cost apps, giving iPhone and Android based phones the best features.  Blackberry's App World has less apps and on the average are 3 times more expensive.  As this gap continues to widen, Blackberry will continue to forfeit it's market share.

Sunday, July 3, 2011

Upgrading Ubuntu


I just upgraded my Ubuntu box from Hardy Heron to Lucid Lynx. I didn't upgrade because of any problems I had with Hardy Heron, … wait. This bares repeating. I didn't have any problem with the version of Linux I had. Unlike various versions of Windows I've had the “pleasure” of purchasing and owning, I didn't upgrade hoping to solve a problem. I didn't have to pay for a new operating system because the old one I had to pay for earlier was defective, unstable, or riddled with security holes. In fact the Ubuntu version I replaced was rock solid, stable, and secure. And the new Ubuntu version was rock solid, stable, and secure. I didn't pay for either version. In fact I never payed for Linux. Linux never forced me to register. Linux is open source and free.

OK, with that perspective, let me return to the upgrade. Here's all I had to do:
  1. Open the Update Manager found under System >> Administration.
  2. Click the “Upgrade” button.
  3. Wait for the automatic download and installation to complete
  4. Watch the automatic reboot
  5. That's it.

And it just worked. Everything did.

Have you ever upgraded Windows? I don't mean the service packs (all the bug and security fixes), I mean have you ever upgraded from an old Windows version to a new Windows version – like from Vista to Windows 7 – or if you're running a server, from Windows 2003 to Windows 2008? Why did you upgrade? Chances are, you were hoping to solve a problem with your existing version. After all, you paid for the existing version (even if it came pre-installed on your computer, you still paid for it as part of the price of your computer). And you had to pay for the new version. So what did you have to do? Order a Windows CD online? Drive to your local computer store to buy a copy? Or worse, if you don't feel confident that you can install a new version of Windows, you most likely bought a whole new computer!

You, yes YOU can trade in your old, buggy Windows operating system for a brand new FREE, SECURE, SOLD, FREE (have I said FREE?) Linux operating system. Regardless of your computer prowess or geekitude, you can do it. You can even try it without committing to it - until you're sure you like it! Here's what you do:
  1. Relax – even in the unlikely even that something goes wrong, you won't hurt your computer
  2. Download Ubuntu and save it anywhere – like on your Desktop for example
  3. Create a CD from the file you just downloaded (see how)
  4. Boot from the CD (see how)
You are now running Ubuntu! If you've followed these instructions, you can decide to keep Ubuntu, or you can simply shutdown your computer, take out the CD, and your computer will be just like it was before you ran Ubuntu. Boot from the CD as often as you like until you're sure. Here are a few things to help you decide:
  1. After a few sessions on Ubuntu, can you find your way around?
  2. Can you do all the things you want to do like read email, surf the web, edit documents, etc?
If you decide you like Ubuntu and you're ready to replace Windows, all you have to do to install it is to click the “Install” icon on the desktop and answer a few simple questions (like what timezone you're in, etc.). And voila!! You're running Ubuntu! You don't have to register it. You don't have to pay for it. And because Linux plays nice, you can still run Windows – Linux gives you that choice when you boot. There are thousands and thousands of free programs for Linux to pick from. When the next version of Ubuntu comes out, you too can upgrade if you like – by just clicking a button.
Last updated: 22 Feb, 2012 10:47