Ivo Apostolov

Rebuild your article aliases with for a few seconds

When this script was written by Plamen Botev (AFAIK), it was supposed to handle the issues for non-Latin languages after migration from Joomla! 1.0 to Joomla! 1.5. It was a major issue for anyone who wanted to turn on the SEF, but during the migration, all the aliases were stripped due to the Cyrillic only letters in it.

Now it turned into something different. Three years ago, in Joomla! there were Latin aliases or nothing (if not using 3PD extension to handle it). That was the reason, several plugins were released to handle that issue.

The internationalism and transliteration of the aliases had a quite nice history in Joomla! 1.5:

  • First it was yvTransliterate from Yuri Volkov. It had good concept, but was a bit complicated for an end user.
  • Based on the idea of yvTransliterate (while no code was used), I created Protos SEF, an extension that transliterates anything on the fly from Bulgarian to Latin.
  • Jan Pavelka, took the idea and created similar plugin for the central European languages.
  • And the culmination was the Unicode Slugs plugin by Jean Marry Simonet, which allowed using any alphabet in the alias.

In Joomla! 1.6 unicode aliases will be supported in the core. So far, so good, but what a mess would happen if your web site is using Latin aliases till some moment and Cyrillic after another.


I had a task these days to re-work a web site with 10k+ articles. 3k of them without aliases (due to migration from 1.0), 5k of them with Latin aliases (with a transliteration plugin) and the last 2k articles with Cyrillic aliases with the Jean Marry’s plugin. So the task was to unify all aliases into single alphabet, following same rules.

At that time, I remember about this script, which was rebuilding the aliases and tested it. Voala, it worked for all articles (only). Not only that, but if you have some of these plugins, that effect the alias creation, the script executes them (i.e. if the JM plugin is enabled, it will re-create all aliases in Cyrillic, if Protos SEF is enabled, it will re-create and transliterate all aliases in Latin).

So, how this script can be useful for you?

  • If you haven’t migrated yet.
  • If you have old articles with non-existing aliases or aliases you want to change at once.
  • If you want to start/stop using aliases in Unicode or by applying transliteration.

How it works?

  • ou first create a backup of your site files, database, anything.
  • Then rename your main index.php file to index.bak.
  • Upload the file, which is in the attached package in the main Joomla! folder.
  • Open your web site, you will see a blank screen. Don’t do anything till you see “Done”.
  • After that delete the index.php file and rename back index.bak to index.php

What will it do?

  • It will delete all existing aliases and rebuild them in the very same way Joomla! creates them automatically.
  • If there are plugins installed which manipulate the Joomla! class for creation of aliases, this plugins will be executed.

Hope you find it useful.

alias_rebuild.zip

Views: 239

Tags: alias, joomla, rebuild, sef

Jo Snow Comment by Jo Snow on February 9, 2010 at 8:08pm
Mana from heaven!!

Over the past couple of days Ive been trying to solve a this very problem when integrating two Joomla sites with different versions.

In fact I was just going to write a post asking developers about their Joomla updating philosophy
Jo Snow Comment by Jo Snow on February 10, 2010 at 2:05am
Tested - worked fine- you weren't exaggerating- just a few seconds
Ivo Apostolov Comment by Ivo Apostolov on February 10, 2010 at 2:15am
Yep, I was thinking if the script can be extended to be used for categories, sections, contacts, menus etc.
Ercan Özkaya Comment by Ercan Özkaya on February 10, 2010 at 2:40pm
I also have a similar script around that runs through all tables to check alias fields. By the way, you can safely put this code in foo.php for example. No need for renaming. You also can just boot the framework and not bother with JApplication. I will try to share mine when I get back to my computer.
Ivo Apostolov Comment by Ivo Apostolov on February 10, 2010 at 2:44pm
Ercan, if it can be extended to support all core aliases, it will be a great script.

Comment

You need to be a member of All Together, As A Whole to add comments!

Join All Together, As A Whole

Badge

Loading…

© 2012   Created by Amy Stephen.

Badges  |  Report an Issue  |  Terms of Service