Sep 23, 2008

Duplicate content with RealURL

Yesterday I checked one of my sites in the Google webmaster tools. It showed me warnings for many pages of the site beyond the home page. It looked like Google found pages two times: once with a normal URL (ending with a slash) and another without ending slash. It treated pages as separate and it thinks that I have double content on the site. Pretty bad as it lowers page rank.

Interestingly all links on the site end with slash. There are no links without ending slash at all. However if such link is requested, RealURL will recognise it and return proper page (duplicate for Google). This is caused by the use of "appendMissingSlash" RealURL configuration option. So if someone links to the page but omits slash in the end, he lowers your page rank. Not truly your (or my fault) but it happens. I have to repeat: this is not a fault of you, me or RealURL. It is created by a wrong linking from external sites.

I thought about a cure and implemented a new option in RealURL. Now "appendMissingSlash" accepts also "redirect" keyword. It means that RealURL will redirect to the proper address (with ending slash). It is possible also to specify the code for redirection ("redirect[301]") but RealURL uses 301 by default.

This version is not yet in TER. I am testing it on one site along with a bugfix #9412 for absRefPrefix. I just thought I announce it a bit earlier. For now you can check your sites in Google webmaster tools.

P.S. No, I cannot send you T3X with this version. But you can always checkout latest development version from TYPO3 SVN if you wish. But I am not responsible for the risk you take by doing it.

Sep 22, 2008

Testing is important

There was a man once. His surname was Murphy. Some believe he was a member of the crew of some American ship. Others believe he was a scientist. The thing is that there is a law of his name, the Murphy's law. It states:

If anything can go wrong, it does.

It does not sound very optimistic. But it explains everything what goes wrong. Especially well it applies to software development.

I always find that if I am lazy or forget to test something, it behaves wrong. For example, I implement five cases, test four, they are ok. I do not test the fifth hoping it is ok too and later I find it is not. It is always like that. If I post something to the mailing lists without checking it first, there is usually a mistake. As soon as I test it, it works ok. Why is that? I do not know. May it just Murphy's law in practice.

Why do I write about it? Testing is a very important part of software development. And testing should be done properly: everything should be tested with all variations. This ensures the quality of the product.

I wonder will be anything wrong with this article if I do not test it now in browser?

Sep 19, 2008

Do you need a page browser for your TYPO3 extension?

I have one for you! Yesterday I uploaded the first version of the "Universal page browser" extension into TER. This extension provides page browsing services to other extensions.

Currently extensions either use their own home made page browser or use default from tslib_pibase. Neither of these solutions is good. Home made page browsers requires time to create and also to maintain. It takes space in the code. The default one is hard to configure, it is not flexible for any modern application. In addition it is table–based, which is not how HTML code should be made these days.

Recently I had to write my own page browser three times in three different extensions and twice used the default one. All these times it was loss of time. If I had a "normal" page browser, I could save on development and debugging.

Armed with this idea I decided to make a page browser that I could use in any other project. I started developing it and then there came one of Netcreators projects, where I could finish this development.

As a result I made a new extension that any other extension case use to integrate a modern highly customizable CSS-based page browser. It is very easy to use. Here is the code:

Sep 16, 2008

Tag your TYPO3 releases in SVN

There are a lot of TYPO3 extensions in the Forge SVN repository but strangely very few of them use SVN tagging.

SVN normally have three directories for each project:
  • branches
    This directory is for separate development of the same product (for example, TYPO3 versions 4.1 and 4.2)
  • tags
    This directory holds snapshots of the project at a certain point in time
  • trunk
    This is the current development directory
Technically tags and branches are the same, it is just a convention that tags are not to be modified.

Sep 15, 2008

Table of content for my TYPO3 programming book

Packt Publishing gave me permission to publish the table of contents for my book about TYPO3 extension programming. Here it is:
  • About TYPO3 API
    This chapter gives an overview of TYPO3 API and tells about most important classes in TYPO3
  • Anatomy of TYPO3 Extension
    This chapters describes files in the TYPO3 extension, what role they play and how to use them
  • Planning Extension
    This chapter focuses on planning. Planning makes extension better. It makes the project successful. The cahpter is not as theoretical as you can expect
  • Generating Extension
    This chapter walks the reader through the process of extension generation. All options are explained, several issues are pointed out, useful tips provided
  • Frontend Plugins: In Depth Study
    This chapter focuses on the Frontend plugin theory. It also provides a lot of tips to make extension effective.
  • Programming Frontend Plugin
    This chapter is dedicated to a practical progamming. The reader will see how ti make list, search and single views, use AJAX from the Frontend plugin and create useful TypoScript for the plugin.
  • Programming Backend Module
    This chapter focuses on the Backend module programming.
  • Finalizing Extension
    This chapter describes how to write documentation for the extension and polish the code before releasing it to TER.
The book is highly practical, contains a lot of my own experience and it helps the reader to become extension programming from zero (PHP and TYPO3 knowledge as user is required).

Sep 14, 2008

Debugging symlinied TYPO3 directories with Komodo IDE on Mac

Update (Dec 03, 2011): this is not longer necessary. Just use PhpStorm IDE instead.

As some of the readers know, I recently switched from the Zend Studio to Komodo IDE for PHP programming and debugging. Recent versions of Zend Studio are slow, often hang, sometimes crash, ask stupid questions (for example, to select a file to debug with only one option) and extremely slow when debugging. Komodo IDE does not have any of these problems. It is not perfect, of course (for example, there are issues with autocomplete) but in general it is much better than Zend Studio.

The only problem that bothered me so far was the inability of Komodo IDE to debug symlinked files.

TYPO3 setup for PHP development

I have several TYPO3 versions checked out from the TYPO3 SVN. I often have to change versions to test extensions or patches in different versions. Therefore I set up my development directory as follows: