« November 2009»
M T W T F S S
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            

[blog...]

06.07.2011
17:43

TYPO3 Language Switch Using HMENU special.language

Language Switch on the Weltcafe Dresden site
defaultLanguageFlag=Deutsch

This week a customer asked me to add a multilanguage switch to his TYPO3 website. No problem, that's easy to realize because I am using such a switch for years now on www.weltcafe-dresden.de.

 

After half an hour, the switch was working but in the meantime I read in TSref (TypoScript Reference) about the special language menu support of the HMENU (Hierarchical Menu) object. Then I played around another hour to get this working. Here is my solution. Just, to find it for the next project:

 

 


temp.language = HMENU
temp.language.special = language
temp.language.special.value = 0,1,2
temp.language {
	1 = TMENU
	1 {
		wrap = <ul class="toplangmenu">|</ul>
		noBlur = 1
		NO = 1
		NO {
			#wrapItemAndSub = <li class="">|</li>
			before =  
	  		after =  <li>/</li> |*|  <li>/</li> |*|  
			linkWrap = <li>|</li>
			# wrap the page title! otherways you see the current page title instead of the language.
			stdWrap.override = [deutsch] || [english] || [francais]
		}
		# active language
		ACT < .NO
		ACT {
			# doNotLinkIt = 1
			linkWrap = <li class="active">|</li>
		}
		# NO + Translation doesn't exist
		USERDEF1 < .NO
		# USERDEF1.doNotLinkIt = 1
		# ACT + Translation doesn't exist
		USERDEF2 < .ACT
		# USERDEF2.doNotLinkIt = 1
	}
}

 

There are four states of this menu:

  • NO for not selected
  • ACT for active selection
  • USERDEF1 which is the same as NO, but there is no translation found
  • USERDEF2 which is the same as ACT, but there is no translation found

So you can avoid the language switch on pages where you have no translations for example with doNotLinkIt = 1.

 

 

Don't forget to set some useful and necessary config options in your TSsetup:

 

 

// Language Switch
config {
  linkVars = L
  sys_language_uid = 0
  language = de
  #Language for the proper "xml:lang" and "lang" value in -Tag
  htmlTag_langKey = de
  locale_all = de_DE.UTF-8  
  sys_language_mode = content_fallback
  sys_language_overlay = 1

}       
[globalVar = GP:L = 1]
config {
  linkVars = L
  sys_language_uid = 1
  language = en
  htmlTag_langKey = en
  locale_all = en_GB.UTF-8
}
[global]

 

 

By chance, I found another setting which is not important but nice for the backend user. Usually you don't create the Default website language (this is done on your root page). So everywhere you may select "DEFAULT" (which is in my case German) and "English" or whatever language you added.

 

To overwrite this DEFAULT label with e.g. Deutsch, do the following on the TS page setup of your root page:

 

 

mod.SHARED {
  defaultLanguageFlag=Deutsch
  defaultLanguageLabel=de.gif
}

 

 

28.06.2011
16:49

fit-pc2 Running With Kernel 2.6.39.2 and Ubuntu 11.04

Kernel 2.6.39.2 with gma500 driver from staging tree

Recently, I spent a couple of hours to update and upgrade my fit-pc2.

 

I started with the kernel which was running 2.6.37.1 with the psb driver for the Intel GMA500 (Poulsbo) graphics engine. Unfortunately this driver isn't maintained anymore and does not compile with 2.6.38 or even 2.6.39 kernels.

But in the meantime, a new driver entered the staging tree of the kernel and is already part of 2.6.39. This driver-directory is called gma500 but the module is named psb_gfx and the driver is named psbfb. This driver supports Kernel Mode Setting (KMS) and uses the fbdev driver from xorg.

It took me some hours to get this running. Of course because I even compile the kernel on the fit-pc2 which is not that fast. But the biggest problem was to find a working kernel config and the setting for the right display resolution. In my case the monitor is connected to DVI (on the HDMI  plug) and has a native resolution of 1440x900.

 

Here is my kernel config for 2.6.39.2 and I had to change the grub default settings in /etc/default/grub for my monitor:

 

 

GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor acpi_skip_timer \
nomodeset video=DVI-D-1:1440x900 pci=nocrs mem=896mb"

 

 

Please note: the current driver doesn't support reading your monitor EDID data by itsself. It will start with 1024x768 by default. To get information about the connector (in my case DVI-D-1), I added the parameter "drm.debug=7" to the kernel command line.

 

I don't know why, but I still need a xorg.conf file. Without it, the USB keyboard and mouse won't work.

 

After the kernel, I upgraded Ubuntu from 10.10 to 11.04 without any problems.

Sound with Intel HDA

With the new kernel, it was'n possible to use the sound as normal user. So I was checking the drivers and the permissions. After killing pulseaudio, it was possible for the root user to playback sound.

 

When reloading the alsa drivers there was always a strange warning I've never seen:

 

sudo alsa force-reload
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/ab/.gvfs

 

 


 

This was the solution: there were some permission issues for this userfilesystem. My solution was the following in the /home/ab/ directory:

 

 

sudo umount .gvfs
chmod 755 .gvfs
sudo /usr/lib/gvfs/gvfs-fuse-daemon .gvfs

Scanimage with Canon LiDE 20

I have a simple flatbed scanner connected via USB and this scanner didn't work with the new 2.6.39 kernel anymore. But why?

 

This was another permission issue because root was able to scan. In my kernel config I disabled CONFIG_USB_DEVICE_CLASS because it is marked as DEPRECATED. The current Ubuntu udev rules seems to prefer the old fashioned way. I had to change the permissions for the new style in /lib/udev/rules.d/50-udev-default.rules:

 

 

# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"

 

 


 

This is of course a dirty workaround and no solution. But anyway. Let's wait for Ubuntu 11.10!

The scanner is found now and working as usual:

 

ab@ab-fit:~$ scanimage -L
device `plustek:libusb:004:009' is a Canon CanoScan N670U/N676U/LiDE20 flatbed scanner
05.05.2011
16:36

xxsvideo is still alive!

xxsvideo on Sourceforge.net

Long time ago, in 2007, I created at mycable the xxsvideo Sourceforge project. This is a simple buildsystem for the xxsvideo embedded board from mycable and Fujitsu.

 

These days, I updated some scripts to support current Ubuntu releases. The old scripts did only work up to Ubuntu 8.04. Not it should work with Ubuntu 10.04 and 10.10.

 

The updated scripts are comitted to the Sourceforge SVN on the project site.

Please have a try and send me patches and/or bugreports if you find something not working as expected. Later on, we could do a new maintenance release out of this.



To check it out just use the following command on your console:

 

 

svn co https://xxsvideo.svn.sourceforge.net/svnroot/xxsvideo xxsvideo

 

 

24.04.2011
09:01

ics_awstats Extension in TYPO3

Screenshot of the awstats backend

ics_awstats is one TYPO3 extension using the perl awstats-script to analyze apache logfiles. It's only for backend-users to see, what's going on. It's possible to start the script manually or to schedule the execution with the TYPO3 scheduler.

 

With last update from 0.3.0 to 0.5.0 the extension stopped working on my installation. The lock-file was created but not deleted anymore and the link for removing it did'nt work.

 

I check the extension for this failure and changed to lines to reactivate it again. Because there is no bugtracker yet on forge for this project, I sent the patch to the maintainer. Hope, he will apply it soon.

 

If you like, you may checkout the patch and apply by yourself.

 

Find more:

 

UPDATE: The maintainer, Reto Zahner from Newmedia AG in Switzerland, fixed this issue and released 0.5.1 some days after my patch and bugreport. Thank you!

19.04.2011
21:36

RSS Feed with Image with TYPO3 t3blog Extension

Screenshot of RSS feed in Opera Browser

On Facebook some feeds of my blog are feeded automatically by the RSS Graffiti application. And I wonder for a while why the tt_news RSS feed contains the preview image but the t3blog RSS feed comes without it.

 

If find images with a short teaser much more interesting than only text. That's why I add an image.

 

I checked out the current class.rss.php from the forge.typo3.org repository. The developers changed a lot since the last release 1.0.0 and there is still no release 1.1.0. But this class didn't worked as expected because there is still a bug inside. So first I made a bugreport with a patch.

 

After this the content:encoded field was filled but the images where gone nevertheless. That's because they strip all  tags out of the description with the PHP function strip_tags(). So I added the -tag to the allowed tags in line 598:

 


 

 

$text = strip_tags($text, '<a><img><b><br><em><hr><i><li><ol><p><strong><ul>');

 

 

[ 07.05.2012 ]