Home

Author Archive

Long awaited - or: how to get IE8 compatibility in TYPO3

Monday, October 12th, 2009 | Author: Benni

Hey,

if anybody followed the latest evolvements in TYPO3, one of my promises was to blog more often. So here comes the first step:

One quick and tiny trick I used pretty often the last months was to add the following meta-tag to let Internet Explorer 8 behave like its predecessor, IE7. The Tag is <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ />. You only need to add this snippet to the head of your HTML page and then you don’t need to worry about your existing design to work in IE8. However, I found out that you need to put this tag right after the <head> Tag for IE8 to recognize this — and well, TYPO3 has no easy way to get HTML code above the classic TYPO3 head comment part, only below (with page.headerData…). That’s why I just put it in the <head> tag, and - there is fortunately something like “PAGE.headTag” since ages in TypoScript. Thus, I only need to put something like that in my TypoScript setup:

page.headTag = <head><meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ />

and my website is looking nice in IE7 (as before) and IE8 (as IE7).

Category: TYPO3 | Leave a Comment

DAM: Hiding fields through TSconfig

Sunday, September 21st, 2008 | Author: Benni

Long time no see… yes, business is keeping me away from all the fun stuff. I’m currently working on cleaning up and then extending mm_forum, and of course the TYPO3 core.  Last week, I visited Jeff in Dallas and we had a good run digging into some serious XML issues with libxml2 and expat (See http://bugs.typo3.org/view.php?id=9359) and we also looked into over 20 patches floating around in the TYPO3 core list.

Yesterday I spent some time working on my seo_basics extension and on the last fixes for the upcoming DAM (Digital Asset Management) version 1.1 — a beast of an extension,  but good for adding metadata to uploaded files. While there was a huge movement in May and June, things kinds slowed down in the last months, and Ben pushed the whole thing a bit more. In any case, 1.1 will be a bugfix release (with a dependency on TYPO3 4.2.2 or later) marking the way for a glorious 1.2 (Release TBA ;-)). more…

Category: TYPO3 | 3 Comments

TypoLink: Tiny Helpers To Save The Day #1

Thursday, July 17th, 2008 | Author: Benni

I more and more enjoy the power of TypoScript. Every day, I learn something new. I will

Tip 1: You want to link to the same page, but with JS params etc,

lib.mytext = TEXT
lib.mytext.value = This is a link
lib.mytext.typolink.parameter = {TSFE:id},775 500x600 selflink
lib.mytext.typolink.parameter.insertData = 1

I had to use this idea when having a big site with a lot of microsites where the client is able to clone a microsite without needing to configure any IDs. The typolink.parameter = this,775.. did not work.

Basically, with this project, I had to make sure that no page IDs were hardcoded in TypoScript, so it was easy to create a new site inside TYPO3.

The following example renders a menu based on keywords (there was a requirement about the page titles) instead of a special = directory type of menu.

lib.rightnav = HMENU
lib.rightnav {
  special = keywords
  special {
    value = 1
    depth = 2
    setKeywords = Contact,Newsletter
    keywordsField = title
    entryLevel = 0
  }
  1 = TMENU
  1 {
    alternativeSortingField = sorting
    noBlur = 1
    NO.allWrap = <li>|</li>
    wrap = <ul class="rightcol_contact">|</ul>
  }
}

The next example shows a tt_news to link to the first subpage as the “single page”.

plugin.tt_news.singlePid.cObject = HMENU
plugin.tt_news.singlePid.cObject {
	special = directory
	special.value.data = TSFE:id
	maxItems = 1
	includeNotInMenu = 1
	1 = TMENU
	1 {
		NO.doNotLinkIt = 1
		NO.stdWrap.field = uid
	}
}

I know it’s not big magic and can be solved differently as well, but it just keeps me busy these days :)

Category: TYPO3 | 3 Comments

When switching from baseURL to absRefPrefix…

Tuesday, July 01st, 2008 | Author: Benni

My latest thing to do is switching my TYPO3 installations from baseURL to absRefPrefix. Ever since this awesome extension realURL was written, there was the need to define the URLs that should be relative to the TYPO3 main directory. Imagine having a TYPO3 installation running under a domain called www.b13.de. Without realURL your TYPO3 generated URLs looked like:

http://www.b13.de/index.php?id=25

Well, we all know that search engines don’t like it and visitors don’t find it as convenient as having a real URL, that looks like that

http://www.b13.de/en/about/downloads/
http://www.b13.de/en/products/saviour-v1/

Great! Let’s do this. RealURL does everything for you. Very simple and good (and bug-free — I love the latest version, thanks Dmitry!). However, if you’re on the downloads page and want to link to the products detail page, then the link will look like

http://www.b13.de/en/about/downloads/en/products/saviour-v1/

The reason is that realURL (or let’s say, your browser) does not know where the root of your installation is. realURL suggests using the <base href=”http://www.b13.de/”> tag to let the browser know that all relative links are relative not to the current page but to the specified base href. You can configure this in TypoScript with config.baseURL = http://www.b13.de/ and then there you go.

This all works fine — and if you have multiple domains, you just need to use TypoScript conditions, but this is all doable. However, in the recent past a few of my clients (NOTE: only the ones with 404 pages managed through TYPO3) ran into problems with strange floods of their log files with zillion 404 calls. The reason was that there are some bots that don’t interpret the baseURL tag, and then call the non-existent URLs (e.g. images), which redirect to the 404 which also includes the 404 path. Yes, quite annoying.

So, I was searching for an alternative. Dmitry posted some information on his blog about this error as well. The htaccess redirect he mentioned worked just fine, but I really wanted to avoid this in general, asking a simple question: “Can’t I just set a slash (/) in front of every URL and file reference of my generated HTML?”. This was something I actually wanted before I used this baseURL configuration option (yes, a long time ago). And, in fact, there was this option “config.absRefPrefix” lying around the whole time, and I never used it. As you can see there are so many things you find every time in TYPO3. With the absRefPrefix option I don’t even need to bother with the domains if I just use

config.absRefPrefix = /

or

config.absRefPrefix = /path/to/my/t3installation/

depending on the location of the TYPO3 mainsite directory. But it looked like it’s not that easy, because I ran into some issues (after switching 4 or 5 sites from baseURL to absRefPrefix).

  • You need to have the latest realURL version and set the “reapplyAbsRefPrefix = true” in your realURL configuration array to keep the prefix.
  • Linking between domains is not as smooth anymore as with the latest realURL and 4.2
  • If you have references to typo3conf/ext/, they won’t be prefixed. I ran into this by having: <link rel=”stylesheet” type=”text/css” href=”typo3conf/ext/rgmedialinks/res/mediabox.css” />. I noticed that this is a bug in the TYPO3 core, so I fixed it.
  • There are still some errors if you use custom extensions. You need to make sure that these work. I had trouble with mailforms and some custom scripts that alter the “img” tag, because the URL wasn’t typo3temp/ anymore but http://www.b13.de/typo3temp, so some default replacements didn’t work anymore. Nothing serious, but just something to keep in mind.
  • The latest issue that the Magic images I added during the baseURL times with the htmlarea RTE didn’t work anymore. A simple htaccess redirect (RewriteRule ^(.+)uploads/(.*?)$ /uploads/$2 [R,L]
    ) worked just in this case.

In my eyes, the real and true solution would be to

  1. get rid of all baseURL tags (in my eyes, it was and will always be just a dirty workaround).
  2. have realURL add the part of the mainsite directory to every relative path when rendering the HTML. There could be an option for multisites to dynamically add the domain to all links, using the domain records.

Category: TYPO3 | 12 Comments

Require to select a category for tt_news

Sunday, June 29th, 2008 | Author: Benni

If you have to customize a TYPO3 installation for your editors, and you use tt_news, you maybe have had the problem. Your editor gives you a call and let’s you know that he can’t see his just finished news in the frontend. You find out that the record is not hidden, but the problem is that the editor hasn’t had a category selected. Most likely it’s because the categories are on the second tab in the TCEforms. (in some cases where we “misue” tt_news, it’s the only thing that is on the second tab). However, the problem is then that the editor saves the record and forgets to attach a category to it. With this simple statement you can force the editor to select a category:

TCEFORM.tt_news.category.config.minitems = 1

This can be done on pagesTSconfig level but also on userTSconfig, and is quite helpful to save some support calls.

Category: TYPO3 | 6 Comments

TypoScript Magic: tt_news Title in Headline or Menu or somewhere

Friday, June 06th, 2008 | Author: Benni

In almost every TYPO3 project of mine, I use this awesomely generic tt_news for displaying news, top offers, etc. In many projects I also have a headline or a breadcrums menu somewhere, telling about the title of the page. tt_news itself offers the possibility to substitute the page title in the <title> tag, however I often use my own title tag rendering, or by using the excellent seo_basics extension :). So the tt_news title is not substituted at all. Therefore I always wrote this little TypoScript snippet that I can use everywhere: more…

Category: TYPO3 | 9 Comments

The good, the bad and the ugly: t3skin

Thursday, June 05th, 2008 | Author: Benni

Ever since the t3skin arrived, there was this nasty thing that bugged me so much: Some tabs in the TYPO3 Backend weren’t styled at all, and they still had the colors of the classic TYPO3 skin.

As of the nature of TYPO3, an installed skin just overrides the classic skin styles and icons, and it seems like the t3skin author forgot about that. The places where you can see these problems is when selecting a link (Element Browser, Browse Links) and inside the DAM. Apparantly these are the only occurences where the “tabMenu” functions from the template.php file are used, all other places (TCEforms) use the dynTabMenu whic is styled. more…

Category: TYPO3 | One Comment

Evolution Of My Footer Code - Part 1

Tuesday, June 03rd, 2008 | Author: Benni

Everybody started out very simple with TYPO3. In case of my projects, I had to update the copyright year, with all my clients of course. At first, I put everything static in my HTML template, so I had to change the year there. Then I put the static string in TypoScript. Nowadays I enjoy the power of TypoScript that automatically updates the year in the footer for me. This means less client calls at the beginning of the year :) more…

Category: TYPO3 | 3 Comments

Override LL-File Labels for a whole Installation

Tuesday, June 03rd, 2008 | Author: Benni

Today I found out something very nice.

I had the problem that I needed to redefine some labels for alanguage file in an extension. This was client-specific, so it wasn’t suitable for a patch to send to the corresponding extension developer. But I didn’t want to modify the extension files by myself, because in case of an upgrade, the changes would have been erased. So I stumbled upon this nice feature, which worked just fine for my TYPO3 4.0 installation. more…

Category: TYPO3 | One Comment